Skip to content

Instantly share code, notes, and snippets.

@nimone
nimone / Carousel.jsx
Last active May 13, 2024 08:35
Build a carousel component like instagram purely in ReactJS and TailwindCSS

Linux 命令行编辑快捷键

初学者在Linux命令窗口(终端)敲命令时,肯定觉得通过输入一串一串的字符的方式来控制计算是效率很低。 但是Linux命令解释器(Shell)是有很多快捷键的,熟练掌握可以极大的提高操作效率。 下面列出最常用的快捷键,这还不是完全版。

  • 命令行快捷键:
    • 常用:
      • Ctrl L :清屏
  • Ctrl M :等效于回车
@zmts
zmts / tokens.md
Last active May 13, 2024 08:35
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@rpdelaney
rpdelaney / traceback_exc.py
Last active May 13, 2024 08:34
Serialize python exceptions into dictionaries
import traceback
from typing import Dict, Union, List
def traceback_exc(exc: Exception) -> Dict[str, Union[str, List[str]]]:
tb = traceback.TracebackException.from_exception(exc, capture_locals=True)
return {
"title": type(exc).__name__,
"message": str(exc),
"traceback": [
@sindresorhus
sindresorhus / esm-package.md
Last active May 13, 2024 08:32
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@dianjuar
dianjuar / i3-shortcuts-screenshot.md
Last active May 13, 2024 08:32
My i3 shortcuts to take screenshots

Requirements

  • maim
  • xclip

Set-up

Set this on your i3 config file ~/.i3/config

# Screenshots
#
# Reply to Weissman 2024
#
# Code to draw the spatial locations of market-linked infections and
# secondary++ infections, and estimate median distance to the market (origin)
#
# Initializations ####
@Artefact2
Artefact2 / README.md
Last active May 13, 2024 08:30
GGUF quantizations overview

Which GGUF is right for me? (Opinionated)

Good question! I am collecting human data on how quantization affects outputs. See here for more information: ggerganov/llama.cpp#5962

In the meantime, use the largest that fully fits in your GPU. If you can comfortably fit Q4_K_S, try using a model with more parameters.

llama.cpp feature matrix

See the wiki upstream: https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix

@torcado194
torcado194 / cleanEdge-shadertoy.glsl
Last active May 13, 2024 08:29
cleanEdge, a pixel art upscaling algorithm for clean rotations
/*** MIT LICENSE
Copyright (c) 2022 torcado
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active May 13, 2024 08:28 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@