Skip to content

Instantly share code, notes, and snippets.

View Sadin's full-sized avatar
👽
Go

Zach Snyder Sadin

👽
Go
View GitHub Profile
@ChevyRay
ChevyRay / qoi.rs
Created November 24, 2021 22:49
QOI - Quote OK Image Format (Rust Port)
const INDEX: u8 = 0x0;
const RUN_8: u8 = 0x40;
const RUN_16: u8 = 0x60;
const DIFF_8: u8 = 0x80;
const DIFF_16: u8 = 0xc0;
const DIFF_24: u8 = 0xe0;
const COLOR: u8 = 0xf0;
const MASK_2: u8 = 0xc0;
const MASK_3: u8 = 0xe0;
@GloriousEggroll
GloriousEggroll / nvidia-installer.sh
Last active May 28, 2023 10:52
nvidia /etc/profile.d/ script
#!/usr/bin/sh
nvgpu=$(lspci | grep -iE 'VGA|3D' | grep -i nvidia | cut -d ":" -f 3)
nvkernmod=$(lspci -k | grep -iEA3 'VGA|3D' | grep -iA3 nvidia | grep -i 'kernel driver' | grep -iE 'vfio-pci|nvidia')
if [[ ! -z $nvgpu ]]; then
if [[ -z $nvkernmod ]]; then
# Check for internet connection
wget -q --spider http://google.com
if [ $? -eq 0 ]; then

Keybase proof

I hereby claim:

  • I am sadin on github.
  • I am zsnyder (https://keybase.io/zsnyder) on keybase.
  • I have a public key ASD_hs9jGbCDk5ey2V9j1M7nagJeW1LlIxqu7M910_fR-Ao

To claim this, I am signing this object:

@Brainiarc7
Brainiarc7 / fstab-generate-arch.md
Last active March 18, 2024 13:51
Generate fstab in Arch Linux

First, install arch-install-scripts:

sudo pacman -S --needed arch-install-scripts

Secondly, mount your partitions in all the internal hard drives.

Thirdly, generate and validate your config by piping it out to stdout:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@Sadin
Sadin / gist:1235039
Created September 22, 2011 15:16
Example of atom feed creator
def entry(record, options = {})
@xml.entry do
@xml.id(options[:id] || "tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}")
if options[:published] || (record.respond_to?(:created_at) && record.created_at)
@xml.published((options[:published] || record.created_at).xmlschema)
end
if options[:updated] || (record.respond_to?(:updated_at) && record.updated_at)
@xml.updated((options[:updated] || record.updated_at).xmlschema)