Skip to content

Instantly share code, notes, and snippets.

@dpoggi
dpoggi / Gemfile
Created March 27, 2011 05:59
AssetsController. See README.txt.
gem 'haml'
@dpoggi
dpoggi / sopa.user.js
Created January 18, 2012 13:06
Get your Wikipedia back, in case you've already been tuned to SOPA news for the last few weeks. An identical copy of this file is at http://files.danpoggi.com/sopa.user.js - you can go there directly to install, or copy and paste the manual way.
// ==UserScript==
// @name I WANT MY F#(*& WIKIPEDIA
// @description Removes the blackout overlay from Wikipedia. Because we already know, and Congress is bound to find a way to mess with the DNS system somehow.
// @match http://en.wikipedia.org/*
// @match https://en.wikipedia.org/*
// @author Dan Poggi
// @version 0.1
// ==/UserScript==
(function () {
@dpoggi
dpoggi / hours.rb
Created August 3, 2012 18:07
YAML Hours Tracker
#!/usr/bin/env ruby
require 'date'
require 'yaml'
class Float
def nearest_half
(self * 2.0).ceil / 2.0
end
end
@dpoggi
dpoggi / roman.c
Last active December 26, 2015 03:39
Roman numerals in C. Because, you know, yeah.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
const char *g_numeral_list[] = {"M", "CM", "D", "CD", "C", "XC",
"L", "XL", "X", "IX", "V", "IV", "I"};
const int g_value_list[] = {1000, 900, 500, 400, 100, 90,
50, 40, 10, 9, 5, 4, 1};
const int g_list_length = 13;
const size_t g_buffer_size = 32;
@dpoggi
dpoggi / CD.js
Last active August 29, 2015 14:15
iTunes Playlist -> Ordered Folder Full of WAVs (for burning CDs on another machine)
var options = {
"outputDir": "${HOME}/Downloads",
"numWorkers": 12,
};
var App = Application.currentApplication();
App.includeStandardAdditions = true;
var Finder = Application("Finder");
var iTunes = Application("iTunes");
var Terminal = Application("Terminal");
@dpoggi
dpoggi / .gitignore
Last active August 29, 2015 14:15
Stack Unwinding (thanks HN!)
*.o
*.obj
*.out
unwind

Keybase proof

I hereby claim:

  • I am dpoggi on github.
  • I am danpoggi (https://keybase.io/danpoggi) on keybase.
  • I have a public key ASAv9nfTZHmD7oQOemBCV2Q2_A1aGl8eE96Kb6iy4OK-3Ao

To claim this, I am signing this object:

@dpoggi
dpoggi / astrobuild.go
Last active August 29, 2015 14:17
AstroBuild Go port
package main
import (
"math"
"time"
"fmt"
"os"
)
var planets map[float64][]string
@dpoggi
dpoggi / things.rb
Created September 23, 2015 20:29
Save the first 10,000 objects in Ruby's VM to a text file for inspection
#!/usr/bin/env ruby
things = (0..10000).map do |n|
begin
ObjectSpace._id2ref(n)
rescue
nil
end
end
@dpoggi
dpoggi / homebrew.mxcl.autossh.plist
Last active December 11, 2022 00:00
launchd plist for Homebrewed autossh (local tunnel)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.autossh</string>
<key>KeepAlive</key>
<true/>