Skip to content

Instantly share code, notes, and snippets.

@ggorlen
ggorlen / no-delay-udacity.js
Last active August 27, 2020 17:12
skip the 5-second delay between videos on udacity
// ==UserScript==
// @name Udacity Video Delay Skipper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description skip the 5-second delay between videos on udacity
// @author ggorlen
// @match https://classroom.udacity.com/courses*
// @grant none
// ==/UserScript==
@ggorlen
ggorlen / TTT.java
Last active April 24, 2021 00:26
Tic Tac Toe with minimax and alpha-beta pruning
class Board {
private int x; // 0b0xxx0xxx0xxx
private int o; // 0b0ooo0ooo0ooo
private int ply;
public Board() {
this.x = 0;
this.o = 0;
this.ply = 0;
}

Raspberry PI B+

Config

Config is located at /boot/config.txt

SSH

ssh pi@123.456.789.123
@ggorlen
ggorlen / stackoverflow-cheatsheet.md
Last active February 18, 2026 03:55
Resources for Stack Overflow
@ggorlen
ggorlen / receiver.pd
Last active August 2, 2020 03:43
Pure Data netsend/netreceive example
#N canvas 866 194 450 300 10;
#X obj 75 71 netsend;
#X msg 46 26 connect 123.456.78.90 8000;
#X floatatom 274 182 5 0 0 0 - - -;
#X obj 116 210 print received;
#X obj 229 213 route a b;
#X floatatom 275 248 5 0 0 0 - - -;
#X floatatom 231 249 5 0 0 0 - - -;
#X obj 176 147 netreceive 7000;
#X obj 350 223 dac~;
@ggorlen
ggorlen / find_same_sized_files.py
Created September 13, 2020 14:43
prints files that have the same number of bytes
"""
prints files that have the same number of bytes
"""
import os
from collections import defaultdict
path = "."
sizes = defaultdict(list)
@ggorlen
ggorlen / remove-empty-folders.py
Created September 13, 2020 15:09
remove empty folders recursively
"""
removes all empty folders recursively in a directory
"""
import os
import sys
def delete_if_empty(path):
if not os.path.isdir(path):
return False
@ggorlen
ggorlen / files_by_size.pl
Last active September 13, 2020 19:58
sort files by size
# list files by size recursively
use strict;
use warnings;
use File::Find;
my @seen;
sub process_file {
push(@seen, [-s $_, $_]) if -f $_;
@ggorlen
ggorlen / tictactoe.c
Created September 13, 2020 20:11
tic tac toe with bitboard, negamax and alpha-beta pruning
/*
* tic tac toe with bitboard, negamax and alpha-beta pruning
*
* todo:
* - variants
* - transposition table
*
* ref:
* - http://libfbp.blogspot.com/2017/05/tic-tac-toe-bitboards.html
*/