Skip to content

Instantly share code, notes, and snippets.

View haze's full-sized avatar
💭
If it's not a challenge I’m not interested

haze

💭
If it's not a challenge I’m not interested
View GitHub Profile
@wader
wader / gist:7016435
Last active April 12, 2022 15:41
ID3v2 notes

ID3v2 notes

Specs can be found at http://id3lib.sourceforge.net/id3/develop.html

Tag size is always a 4 byte synch safe big endian integer and unsynchronization does not affect it.

v2.2

Frame have 3 byte type.
Frame size is 3 bytes big endian integer (not synch safe).

@cwonrails
cwonrails / nukenode.sh
Last active March 24, 2021 15:20
Completely uninstall node.js and npm on Mac OSX regardless of installation method (excluding nvm.) Combined from answers here: https://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x
brew uninstall node; brew prune; sudo rm /usr/local/bin/npm; sudo rm /usr/local/share/man/man1/node.1; sudo rm /usr/local/lib/dtrace/node.d; sudo rm -rf ~/.npm; sudo rm -rf ~/.node-gyp; sudo rm /opt/local/bin/node; sudo rm -rf /opt/local/lib/node_modules; lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done; sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*;
@hosackm
hosackm / flaskaudiostream.py
Created September 2, 2015 22:30
Flask streaming an audio file
from flask import Flask, Response
app = Flask(__name__)
@app.route("/wav")
def streamwav():
def generate():
with open("signals/song.wav", "rb") as fwav:
data = fwav.read(1024)
@joepie91
joepie91 / vpn.md
Last active July 24, 2024 17:46
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@andrewrk
andrewrk / 3let.py
Created February 15, 2016 03:27
origin of the zig programming language name. https://github.com/andrewrk/zig/
import string
import random
vowels = "aoeuiy"
def m():
c1 = vowels[random.randint(0,len(vowels)-1)]
c2 = string.ascii_lowercase[random.randint(0,len(string.ascii_lowercase)-1)]
c3 = string.ascii_lowercase[random.randint(0,len(string.ascii_lowercase)-1)]
print('z' + c1 + c2 + c3)
m()
@DeflatedPickle
DeflatedPickle / MinecraftEnergyTypes.md
Last active July 19, 2024 22:21
A simple table for Minecraft energy types and a matrix for conversion rates.

Minecraft Energy Types


Energy Name Abbreviation Original Mod Version
Anima AM Anima-Mundi 1.11.2
Blutricity BE (NO) Redpower 1.6.4
Charge RP (NO)/Fz? Factorization 1.7.10
Crystal Flux CF Actually Additions 1.12
@LnL7
LnL7 / configuration.nix
Last active July 10, 2024 03:34
NixOS configuration overlays
{ config, pkgs, ... }:
let
# Import unstable channel.
# sudo nix-channel --add http://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
# sudo nix-channel --update nixpkgs-unstable
unstable = import <nixpkgs-unstable> {};
in
{
@a1ip
a1ip / hostname.md
Last active March 18, 2024 00:01
How to set the Mac hostname or computer name from the terminal

How to set the Mac hostname or computer name from the terminal

  1. Open a terminal.
  2. Type the following command to change the primary hostname of your Mac: This is your fully qualified hostname, for example myMac.domain.com
sudo scutil --set HostName <new host name>
  1. Type the following command to change the Bonjour hostname of your Mac: This is the name usable on the local network, for example myMac.local.
@kprotty
kprotty / AutoResetEvent.cfg
Last active January 11, 2021 02:05
Formally proving the correctness of synchronization primitives
INIT Init
NEXT Next
CONSTANT Setters = 3
INVARIANTS
IsEventuallySet
NoWaiterDeadlock