Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / Gemfile
Created March 27, 2011 05:59
AssetsController. See README.txt.
gem 'haml'