Skip to content

Instantly share code, notes, and snippets.

@cassidoo
cassidoo / mergerefs.jsx
Created January 10, 2023 22:57
Merge refs in React so a component can have more than one ref
export function mergeRefs(refs) {
return (value) => {
refs.forEach((ref) => {
if (typeof ref === "function") {
ref(value);
} else if (ref != null) {
ref.current = value;
}
});
};
@senthilmurukang
senthilmurukang / stash-copy.sh
Last active May 10, 2024 15:50
shell script to copy stash from one folder to another. Example usage: ./stash-copy.sh /path/to/git/old/folder /path/to/git/new/folder
src=$1
dest=$2
current_directory=$(pwd)
cd $src
stashes=$(git stash list)
IFS=$'\n'
stash_messages=()
for stash in $stashes; do
@sataniceypz
sataniceypz / alive.js
Last active May 10, 2024 15:49 — forked from Kingbadan321/alive.js
Custom Alive For Izumi-xd
const { command, isPrivate, getBuffer } = require("../lib/");
const config = require("../config");
// Edit here 👇🏿🌸
let title = "𝗜𝗭𝗨𝗠𝗜-𝗫𝗗"
let body = "𝗛𝗲𝘆 𝗜𝘇𝘂𝗺𝗶 𝗶𝘀 𝗔𝗹𝗶𝘃𝗲🧚‍♂️"
let sourceUrl = "github.com/sataniceypz/Izumi-v2"
let mediaUrl = "github.com/sataniceypz/Izumi-v2"
let mediaType = 1
@mrudang-vora
mrudang-vora / CalculateCRC16.py
Last active May 10, 2024 15:49
Python: CRC 16 ITU calculation
#Working example: http://pythonfiddle.com/crc-16-calculation
def GetCrc16(strHexData):
crc16tab = (
0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF,
0x8C48, 0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7,
0x1081, 0x0108, 0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E,
0x9CC9, 0x8D40, 0xBFDB, 0xAE52, 0xDAED, 0xCB64, 0xF9FF, 0xE876,
0x2102, 0x308B, 0x0210, 0x1399, 0x6726, 0x76AF, 0x4434, 0x55BD,
0xAD4A, 0xBCC3, 0x8E58, 0x9FD1, 0xEB6E, 0xFAE7, 0xC87C, 0xD9F5,
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 10, 2024 15:48
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@0xdevalias
0xdevalias / fingerprinting-minified-javascript-libraries-ast-fingerprinting-source-code-similarity-etc.md
Last active May 10, 2024 15:48
Some notes and tools on fingerprinting minified JavaScript libraries, AST fingerprinting, source code similarity, etc

Fingerprinting Minified JavaScript Libraries / AST Fingerprinting / Source Code Similarity / Etc

Some notes and tools on fingerprinting minified JavaScript libraries, AST fingerprinting, source code similarity, etc.

Table of Contents

@0xdevalias
0xdevalias / video-editors.md
Created April 8, 2024 05:44
Some notes on video editors

Video Editors

Some notes on video editors.

Table of Contents

Unsorted

@mobdev-foitt
mobdev-foitt / XcodeFormatting
Created October 7, 2021 09:39
Xcode Script - XcodeFormatting Raw
set -e
defaults write com.apple.dt.Xcode DVTTextEditorTrimTrailingWhitespace -bool YES
defaults write com.apple.dt.Xcode DVTTextEditorTrimWhitespaceOnlyLines -bool YES
defaults write com.apple.dt.Xcode DVTTextIndentTabWidth -int 2
defaults write com.apple.dt.Xcode DVTTextIndentWidth -int 2
defaults write com.apple.dt.Xcode DVTTextPageGuideLocation -int 100
@doolio
doolio / .dir-locals.el
Last active May 10, 2024 15:47
.dir-locals.el for use with the Emacs Eglot LSP client and python-lsp-server (pylsp) LSP server
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
;;; Commentary:
;; .dir-locals.el for use with the Emacs Eglot LSP client and
;; python-lsp-server (pylsp) LSP server v1.10.0.
;; Default values in accordance with
;; https://github.com/python-lsp/python-lsp-server/blob/v1.10.0/CONFIGURATION.md
@cobaohieu
cobaohieu / fix-os-upgrade.md
Last active May 10, 2024 15:47
fix Your python3 install is corrupted. Please fix the '/usr/bin/python3' symlink.

sudo apt install --reinstall python3

sudo apt install --reinstall python

`` sudo update-alternatives --remove-all python