Skip to content

Instantly share code, notes, and snippets.

View reillysiemens's full-sized avatar
🦀
cargo install coffee

Reilly Tucker Siemens reillysiemens

🦀
cargo install coffee
View GitHub Profile
@sampollard
sampollard / minionize.sh
Created November 21, 2015 07:56
Add (feat. Minions) to every mp3 file song title
#!/bin/bash
for song in $(find ~ -iname *.mp3)
do
title=$(id3info $song | awk -F ':' '/TIT2/{print $NF}')
id3tag -s "$title (feat. Minions)" $song
done
@RichardBronosky
RichardBronosky / Heimdall.sgs3.md
Last active December 16, 2015 00:38
How I unbricked my T-Mobile Samsung Galaxy S III (S3) after a botched CyanogenMod update.

Note:

  1. When booting into Recovery or Download mode, it's okay/best to press power just a split second after Home+Up or Home+Down
  2. After reinserting the battery I find it safest to be patient and wait for the blocky battery icon to appear and disappear.
  3. When booting into Download mode, you have to let go of the buttons before the screen draws. Otherwise the Down button is interpreted as Cancel

So, your Samsung Galaxy S3 won't boot into recovery mode?

  • You are on a Mac and can't get any help from all these Odin posts.
@bgschiller
bgschiller / Makefile
Created December 13, 2013 04:03
A thread-based pseudorandom number generator, and two adversaries that defeat it. Code for the blog post at http://brianschiller.com/blog/2013/12/12/pthreads-and-prngs-oh-my.html
all: thread_prng adversary Makefile advantages
thread_prng: thread_prng.c
gcc --std=c99 -o thread_prng -lpthread thread_prng.c
adversary: adversary.c
gcc --std=c99 -o adversary adversary.c
advantages: adversary thread_prng
for option in r m; do \
@bethanylong
bethanylong / beacon.c
Created February 24, 2015 06:57
Sample beacon frame sent over mon0
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <netpacket/packet.h>
#include <net/ethernet.h>
#include <netdb.h>
@bethanylong
bethanylong / transforming_hello.c
Created October 18, 2016 22:25
"Hello world" demo program for gdb talk
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
const int BUFSIZE = 1024;
const int ARBITRARY_THRESHOLD = 3;
int is_uppercase(char ch) {
return ch >= 'A' && ch <= 'Z';
}
@RadicalZephyr
RadicalZephyr / slack_emoji_liberator.js
Created January 27, 2017 08:19
Slack Emoji Liberator
// Download all the custom emoji your slack team have created!
// Start by going to the "Customize Emoji" screen for your Slack team.
// Open up a browser console and run the following JS
var pattern = new RegExp("https://emoji.slack-edge.com/.*?/([^/]+?)/[^/]+(\.png|jpg|gif)");
function link_text (url) {
var match = pattern.exec(url);
if (match) {
@gmodarelli
gmodarelli / Setup Solarized for Gnome on Ubuntu 13.04.md
Last active July 14, 2020 15:59
Setup Solarized for Gnome on Ubuntu 13.04

Dark version

wget --no-check-certificate https://raw.github.com/seebi/dircolors-solarized/master/dircolors.ansi-dark
mv dircolors.ansi-dark .dircolors
eval `dircolors ~/.dircolors`

git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git
cd gnome-terminal-colors-solarized
./set_dark.sh
@cbhl
cbhl / video_trimmer.py
Created October 13, 2012 21:50
Trimming a video in Python
from subprocess import Popen, PIPE, STDOUT
import subprocess
import math, sys
from time import sleep
from os import path, access, W_OK, R_OK, F_OK
def cut(movie, start, clip):
subprocess.Popen(["ffmpeg", #Calls ffmpeg program
"-ss",str(start), #Begining of recording, must be string
"-t", '30', #How long to record clip for, must be a string

1. Separation of immutable and mutable logic

Quite a lot of different people have been on the same trail of thought. Gary Bernhardt's formulation of a "functional core, imperative shell" seems to be the most voiced.

"Boundaries" - Gary Bernhardt

"Imperative shell" that wraps and uses your "functional core".. The result of this is that the shell has fewer paths, but more dependencies. The core contains no dependencies, but encapsulates the different logic paths. So we’re encapsulating dependencies on one side, and business logic on the other side. Or put another way, the way to figure out the separation is by doing as much as you can without mutation, and then encapsulating the mutation separately. Functional core — Many fast unit tests. Imperative shell — Few integration tests

https://www.youtube.com/watch?v=yTkzNHF6rMs

@DanB91
DanB91 / README.txt
Last active November 28, 2022 04:57
Playdate Zig starting point
THIS GIST IS OUT OF DATE! Please use my new project template here to get started with Zig on Playdate:
https://github.com/DanB91/Zig-Playdate-Template
The rest of this is preservied for historical reasons:
This is a small snippet of some code to get you started for developing for the Playdate on Zig. This code should be used as a starting point and may not compile without some massaging. This code has only been tested out on macOS and you'll need to modify the addSharedLibrary() portion of build.zig to output a .dll or .so instead of a .dylib, depending on you platform.
This code will help you produce both an executable for the Playdate simulator and also an executable that actually run on the Playdate hardware.