Skip to content

Instantly share code, notes, and snippets.

@SonoSooS
SonoSooS / gbanotif.sh
Created January 28, 2016 15:12
GBATemp notifier written in bash
#!/bin/bash
# ===================================
# GBATemp notifier bash script
#
# created by MarcusD
# Copyright $(date +"%Y")
#
# :P
# ===================================
@SamCyanide
SamCyanide / helloworld.java
Last active May 27, 2017 07:46
Made by https://github.com/cory2067 | /u/Cory2067 on Reddit
import java.util.ArrayList;
public class HelloWorld {
public static final Integer a = 104;
private volatile static Object ob = "o";
public static void good() {
class NiceInnerClass { public NiceInnerClass(){System.out.print('e'); abstract class xx {}}}
Object object = new NiceInnerClass();
}
@videah
videah / howhorrifying.lua
Created October 23, 2015 22:06
LuaJIT supports Unicode characters as variable names. This allows you to do horrific things like this
-- Prints 'helloworld'​
= 'h'
​​ = 'e'
​​​ = 'l'
​​​​ = ​​​
​​​​​ = 'o'
​​​​​​ = 'w'
​​​​​​​ = ​​​​​
​​​​​​​​ = 'r'
@xvitaly
xvitaly / remove_crw.cmd
Last active January 14, 2025 04:48
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
@ryancdotorg
ryancdotorg / frag32.py
Created August 20, 2015 16:27
A FAT32 fragmenter, because I am a horrible person.
#!/usr/bin/env python
import random
import struct
import sys
# Most of the Fat32 class was cribbed from https://gist.github.com/jonte/4577833
def ppNum(num):
return "%s (%s)" % (hex(num), num)
@haasn
haasn / about:config.md
Last active December 27, 2024 15:46
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.

#!/usr/bin/env perl
# Copyright (c) 2015 Sergey Lyubka
# All rights reserved
use Encode;
my $dir = "/Users/$ENV{USER}/.Trash";
sub read_file($) { local $/; open FD, $_[0] or die $_[0]; binmode FD; <FD>; }
@smealum
smealum / bin2wav.py
Last active July 12, 2024 18:59
bangai-o soundhax
import sys
import wave
import struct
# bit0 is a single period sine wave at 1024Hz with a given amplitude
# bit1 is the same but with ~2.7 times the amplitude
bits = [[0x00, 0x09, 0x12, 0x1A, 0x21, 0x27, 0x2C, 0x2F, 0x30, 0x2F, 0x2C, 0x27, 0x21, 0x1A, 0x12, 0x09, 0x00, 0xF6, 0xED, 0xE5, 0xDE, 0xD8, 0xD3, 0xD0, 0xD0, 0xD0, 0xD3, 0xD8, 0xDE, 0xE5, 0xED, 0xF6], [0x00, 0x18, 0x30, 0x46, 0x59, 0x69, 0x75, 0x7C, 0x7F, 0x7C, 0x75, 0x69, 0x59, 0x46, 0x30, 0x18, 0x00, 0xE7, 0xCF, 0xB9, 0xA6, 0x96, 0x8A, 0x83, 0x81, 0x83, 0x8A, 0x96, 0xA6, 0xB9, 0xCF, 0xE7]]
bits[0] = [b^0x80 for b in bits[0]]
bits[1] = [b^0x80 for b in bits[1]]
bits[0] = struct.pack('%sB' % len(bits[0]), *bits[0])
@henvic
henvic / Migration.md
Last active May 14, 2024 21:40
Migrating to a new Mac

Here are the steps I took for migrating from a early-2013 MacBook Pro Retina 15-inch to a late-2013 one.

  1. Disconnected from the Internet (at least it will simplify
  2. Updated my TimeMachine (TM) backup ("Back Up Now" on the status bar)
  3. Disconnected my TM hard drive and connected it to the new Mac
  4. Turned off the TM backup and Backblaze from the old machine
  5. Connected the TM backup disk to the new Mac
  6. Selected the TM restore process on the install process, but it never showed up, so I restarted it with the 'option' key down and selected the TM code, entered its password and continued with the installer from there
  7. Waited about 3 hours till the data transfer (about 200GB from a stock external drive) was done
  8. Logged in my account
import struct
import math
import os
import sys
from PIL import Image
from subprocess import call
if sys.version > '3':
buffer = memoryview