Skip to content

Instantly share code, notes, and snippets.

@JohnAtl
JohnAtl / check-nvidia-cuda
Created January 5, 2024 15:25
Distrobox with Tensorflow and Nvidia support
#!/bin/bash
# Adapted from https://stackoverflow.com/a/47436840
function lib_installed() { /sbin/ldconfig -N -v $(sed 's/:/ /' <<< $LD_LIBRARY_PATH) 2>/dev/null | grep $1; }
function check() { lib_installed $1 && echo "$1 is installed" || echo -e "\nERROR: $1 is NOT installed\n"; }
check libcuda.so
check libcudart
check libcudnn
@nachowski
nachowski / after.png
Last active May 14, 2024 05:18
Remove booking.com dark patterns
after.png
@tadfisher
tadfisher / build.nix
Last active May 14, 2024 05:18
Simplified Nix integration with Gradle
{ lib
, stdenv
, jdk
, gradle
, mavenRepo
}:
stdenv.mkDerivation {
pname = "built-with-gradle";
version = "0.0";
@michaelcurry
michaelcurry / rfc-template.md
Created September 29, 2016 18:07
RFC Template [Markdown]

RFC Template

Feature Name: (fill me in with a unique identity, myawesomefeature)

Type: (feature, enhancement)

Start Date: (fill me in with today's date, YYYY-MM-DD)

Author: (your names)

@justinian
justinian / linux-x64-nasm-cheatsheet.md
Last active May 14, 2024 05:16
x64 NASM Cheat Sheet

x64 NASM cheat sheet

Registers

64 bit 32 bit 16 bit 8 bit
A (accumulator) RAX EAX AX AL
B (base, addressing) RBX EBX BX BL
C (counter, iterations) RCX ECX CX CL
D (data) RDX EDX DX DL
@yellowbyte
yellowbyte / compiling_asm.md
Last active May 14, 2024 05:16
how to assemble assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc

32-bit ELF binary

how to assemble and link:

nasm -f elf32 -o <filename>.o <filename>.asm
ld -m elf_i386 -o <filename> <filename>.o

template code (hello world):

section .text
global _start
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@napsterrahul
napsterrahul / List.md
Last active May 14, 2024 05:12
List of open source projects made with Laravel
@fernandovaller
fernandovaller / gist:d18698463b33703242b4bcd76183e089
Created November 9, 2017 19:54
List of Android "Secret" Codes, Tips, and Tricks
As pointed out from comments these are mostly for Samsung, I have added some for HTC below. Like I said this is just a start we can build form it. If anyone would like to create a Google Doc from this information please feel free I will add a link to this post.
SAMSUNG CODES
Code Description
*#*#4636#*#* Display information about Phone, Battery and Usage statistics
*#*#7780#*#* Restting your phone to factory state-Only deletes application data and applications
*2767*3855# It's a complete wiping of your mobile also it reinstalls the phones firmware
*#*#34971539#*#* Shows completes information about the camera
*#*#7594#*#* Changing the power button behavior-Enables direct poweroff once the code enabled
*#*#273283*255*663282*#*#* For a quick backup to all your media files
*#*#197328640#*#* Enabling test mode for service activity