Skip to content

Instantly share code, notes, and snippets.

View spraints's full-sized avatar
🦦

Matt Burke spraints

🦦
View GitHub Profile
@peterc
peterc / dnsd.rb
Created December 2, 2011 23:47
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL
# US English translations for Ruby on Rails
#
# Use this as the base for the locale file of your language.
# Things in a "formats" section for date or time can be called
# like `Date.today.to_s(:short_us)`, without creating an
# initializer to merge the stuffs.
en:
date:
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
#guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' }, :wait => 60 do
# watch('config/application.rb')
# watch('config/environment.rb')
# watch(%r{^config/environments/.+\.rb$})
# watch(%r{^config/initializers/.+\.rb$})
# watch('Gemfile')
# watch('Gemfile.lock')
#/ Usage: sudo ruby docker-aufs-fsck.rb
#/ Your docker aufs storage will be checked for orphaned or missing layers.
def main
aufs_root = find_aufs_root
die "Could not find aufs root!" if aufs_root.nil?
fsck = Fsck.new({
:images => `docker images -a -q --no-trunc`.split(/\s+/),
:containers => `docker ps -a -q --no-trunc`.split(/\s+/),
@spraints
spraints / farmhacks.md
Last active August 29, 2015 14:27
Farm Hacks
@spraints
spraints / .gitignore
Last active August 20, 2016 22:40
farmersmarket.com helpers
.bundle
@spraints
spraints / go.command
Last active April 13, 2017 00:26
Stitch a folder of images into a movie
#!/bin/bash
root=$(cd $(dirname "$0"); pwd)
cd $root
exec ruby process.rb "$@"
@shlomi-noach
shlomi-noach / slack-css-override.css
Last active November 16, 2017 12:51
Slack CSS override
/*
// Override Slack CSS
// Tested with Slack 2.8.2 Direct Download
// Instructions:
// - Append the following javascript code to:
// - /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js (MacOS/X)
// - /usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js (Debian/Ubuntu)
@leptos-null
leptos-null / Mojave-dynamic-wallpapers.md
Last active April 29, 2021 12:26
Mojave Dynamic Desktop- How it works

Mojave Dynamic Desktop- How it works

Prompted by a tweet by NSHipster, and a subsequent thread, I wanted to find out how Mojave dynamic wallpapers worked. NSHipster and ole reverse engineered the file format. In the Twitter thread, NSHipster mentions an edge case: What happens above 66ºN (latitude)?

The first thing to do was find out what process handles the wallpaper on macOS. I primarily do iOS research, and honestly had no idea. I opened Console, searched for "solar", and then changed my static wallpaper to a dynamic one. Voila!

Message: index: 7 next: 14815.999366

Process: Dock