This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= navigation([ | |
{:overview => root_url}, | |
{:courses => courses_path}, | |
{:admin => admin_root_path} | |
], :authorize => [:admin], :with => :administrator?)%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyModule | |
def self.hello | |
puts "hello" | |
end | |
end | |
MyModule.hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hash = Hash.new | |
arr = [1, 1, 1, 2, 2] | |
arr.compact.uniq.count {|a| hash[a] = arr.count(a)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Do common operations on dates""" | |
__author__ = "Jarod Luebbert ([email protected])" | |
__version__ = "$Revision: 0.0.1 $" | |
__date__ = "$Date: 2010/04/01 10:57PM $" | |
from math import ceil | |
class Date: | |
"Stores date information" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= 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 |