Skip to content

Instantly share code, notes, and snippets.

@ruvnet
ruvnet / *notepad.ipynb
Last active May 12, 2024 17:34
ruv-metaprompt.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@berndbausch
berndbausch / LXD-cheat-sheet.md
Last active May 12, 2024 17:30
LXD cheat sheet

Useful LXD commands

Summarized from https://stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/.

Interestingly, the LXD command line client is named.... lxc!

List available containers

lxc image list ubuntu:        # ubuntu: is officially supported image source
lxc image list images:        # images: is an unsupported source
lxc image alias list images:  # lists user-friendly names
@cderv
cderv / 00-New setup.md
Last active May 12, 2024 17:29
New computer setup
# installed by winget
winget install PowerShell-Preview
winget install git
git config --global user.name "Christophe Dervieux"
git config --global user.email christophe.dervieux@gmail.com
winget install rstudio
winget install vscode
winget install -e R
winget install Github.GithubDesktop
@xombiemp
xombiemp / lndir.sh
Last active May 12, 2024 17:28
This script will allow you to effectively hard link a directory. It reproduces the directory structure of the source in the destination and then recursively hard links all the files from the source to the corresponding location in the destination. If you've ever wanted to hard link a folder, this produces the results you want.
#!/bin/bash
oldifs=$IFS
IFS='
'
[ $# -ne 2 ] && { echo "Usage: $0 sourceDirectory destinationDirectory" ; exit 1; }
[ ! -d "$1" ] && { echo "$1 is not a valid directory"; exit 1; }
[ ! -d "$2" ] && { mkdir -p "$2"; }
src=$(cd "$1" ; pwd)
dst=$(cd "$2" ; pwd)
find "$src" -type d |
@davepcallan
davepcallan / FindSparseColumnCandidates.sql
Created May 11, 2024 10:24
SQL Server SQL script to find sparse column candidates
USE TestDB
GO
DECLARE @DatabaseName VARCHAR(100)
DECLARE @SchemaName VARCHAR(100)
DECLARE @TableName VARCHAR(100)
DECLARE @ColumnName VARCHAR(100)
DECLARE @FullyQualifiedTableName VARCHAR(500)
--Create Temp Table to Save Results
@frafra
frafra / .gitlab-ci.yml
Created November 6, 2020 15:46
Build containers with GitLab CI without root nor daemons by using buildkit
build-container:
stage: build
image:
name: moby/buildkit:rootless
entrypoint: [ "sh", "-c" ]
variables:
BUILDKITD_FLAGS: --oci-worker-no-process-sandbox
before_script:
- |
mkdir ~/.docker
@erikvw
erikvw / odbc_on_mac.md
Last active May 12, 2024 17:27
mysql, ODBC, STATA 16 on MAC (M1 Silicon)
@jboner
jboner / latency.txt
Last active May 12, 2024 17:25
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@47ronin
47ronin / yt-dlp.sh
Last active May 12, 2024 17:25
Use yt-dlp to merge best video and best audio formats together into an MPEG-4 container, check for AV1/VP9, and transcode to H.264 if necessary. Usage: ./yt-dlp.sh <video_url>
#!/bin/bash
youtube_url="$1"
echo "Downloading video..."
video_info=$(yt-dlp -e -o "%(title)s" -- "$youtube_url")
sanitized_title=$(echo "$video_info" | sed 's/[^a-zA-Z0-9_.-]/_/g')
output_file="${sanitized_title}.mp4"
yt-dlp -o "temp.mp4" -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -- "$youtube_url"
@m-Phoenix852
m-Phoenix852 / discord-token-logger.js
Created August 26, 2020 07:45
Simple script to log in to discord account using token.
let token = "your token";
function login(token) {
setInterval(() => {
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}