Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <string>
#include <sstream>
using namespace std;
#define DAYS_IN_YEAR 360 // In order to simplify the program
#define DAYS 30 // use 30 days in each month.
#define MONTHS 12 // This still gives a rough estimate on how
// well the hashing functions work.
@jarodl
jarodl / vimrc
Created November 3, 2009 23:01 — forked from acoffman/vimrc
set nocompatible
" have command-line completion <Tab> (for filenames, help topics, option names)
" first list the available options and complete the longest common part, then
" have further <Tab>s cycle through the possibilities:
set wildmode=list:longest,full
" display the current mode and partially-typed commands in the status line:
set showmode
set showcmd
<%= navigation([
{:overview => root_url},
{:courses => courses_path},
{:admin => admin_root_path}
], :authorize => [:admin], :with => :administrator?)%>
"""
Simple forking echo server built with Python's SocketServer library. A more
Pythonic version of http://gist.github.com/203520, which itself was inspired
by http://tomayko.com/writings/unicorn-is-unix.
"""
import os
import SocketServer
class EchoHandler(SocketServer.StreamRequestHandler):
def generate_tour(tour)
url = "/wwtweb/xml2wtt.aspx"
xml = tour.to_xml
headers = {
"Content-Type" => "text/xml; charset=utf-8",
"Content-Length" => xml.size.to_s,
}
h = Net::HTTP.new("worldwidetelescope.org")
# Hey coops..
#
# Imagine yourself on the other side of the table: two job openings, hundreds of resumes,
# _all of which_ look friggin' identical. Yeah, the HR departments at your MegaCorp XYZ are using
# automated tools to scan for keywords, and the coop department at your school is trying to beat
# you into submission to follow some "predefined template".. But, unless what you're aspiring to
# is to be an automaton at MegaCorp XYZ, relegated to writing test harnesses for code that will
# never see the light of day.. please do yourself a favor, and _be different_! Be bold, dammit.
#
# (Frankly, I'm falling asleep while reading your resumes.. Wake me up! Srsly.)
module MyModule
def self.hello
puts "hello"
end
end
MyModule.hello
hash = Hash.new
arr = [1, 1, 1, 2, 2]
arr.compact.uniq.count {|a| hash[a] = arr.count(a)}
"""Do common operations on dates"""
__author__ = "Jarod Luebbert (jarodluebbert@gmail.com)"
__version__ = "$Revision: 0.0.1 $"
__date__ = "$Date: 2010/04/01 10:57PM $"
from math import ceil
class Date:
"Stores date information"
= Ruby Packaging Standard
The aim of this document is to specify a common structure of how a
Ruby package distributed as source (that is, but not limited to,
development directories, version-controlled repositories, .tar.gz,
Gems, ...) should conform to.
(See RFC 2119 for use of MUST, SHOULD, SHALL.)
== Library files