Skip to content

Instantly share code, notes, and snippets.

View maxjustus's full-sized avatar

Max Justus Spransy maxjustus

  • People With Jetpacks
  • Los Angeles, CA
View GitHub Profile
@artyom
artyom / resave.go
Created November 25, 2013 12:41
Remove EXIF data from image by resaving it.
package main
import (
"image"
"image/jpeg"
"log"
"os"
)
func main() {
# Hook into unicorn, unicorn middleware, not rack middleware
#
# Since we need no knowledge about the request we can simply
# hook unicorn
module Middleware::UnicornOobgc
MIN_REQUESTS_PER_OOBGC = 5
MAX_DELTAS = 20
@JalfResi
JalfResi / revprox.go
Last active May 7, 2025 07:35
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@ryandotsmith
ryandotsmith / lock.sh
Last active October 11, 2015 22:27
Locking using LOCKFILE(1)
export t=$(date +%s)
lockfile $t #create lock. Try running `lockfile $t` in another shell.
rm -f $t #delete lock
namespace :redis_failover do
task :monitor_client do
require 'redis_failover'
zookeepers = ENV['ZOOKEEPERS']
if !zookeepers && zookeepers_file = ENV['ZOOKEEPERS_FILE']
if File.exists?(zookeepers_file)
zookeepers = File.read(zookeepers_file).chomp
end
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 15, 2025 15:49 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
class HammingCode
attr_reader :data_bits
def initialize(number)
@number = number
@data_bits = number.to_s(2)
end
def parity_bits
indexes = []
current_index = 3
@eric
eric / cubism.papertrail.js
Created June 1, 2012 04:37
cubism.js source for Papertrail
/*
* Cubism source for Papertrail
* https://papertrailapp.com/
*/
cubism.context.prototype.papertrail = function(token) {
var source = {};
source.metric = function(expression, title) {
var lookup = {};