Skip to content

Instantly share code, notes, and snippets.

View natebenes's full-sized avatar

Nate Benes natebenes

View GitHub Profile
@natebenes
natebenes / cookie-monster.js
Created October 13, 2011 21:48
Cookie Monster!
def profile_pic(email,size)
digest = Digest::MD5.hexdigest(email,size)
# we want to allow parallel downloads,
# but we don't want to bust caches
if(%w(0 1 2 3 4 5 6 7).include? digest[0])
host = "img0"
else
host = "img1"
end
return "http://" + host + ".lnkherd.com/avatar/" + digest + "?s=" + size + "&r=pg&d=retro"
# Enable the partner repository and update apt
sudo add-apt-repository “deb http://archive.canonical.com/ natty partner”
sudo apt-get update
# Install Sun's Java VM
sudo apt-get install sun-java6-jre
# Set the default java and javaws binary
sudo update-alternatives --config java
sudo update-alternatives --config javaws
@natebenes
natebenes / app.rb
Created July 29, 2011 16:15
My feed reader is too stupid to understand Sharepoint's stupid NTLM auth scheme, this is a proxy. Its fairly hacky...
require 'rubygems'
require 'sinatra'
require 'typhoeus'
require 'base64'
get '/' do
"hi"
end
# Now you can visit myserver.com/calendar1 and see your feeds!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta lang="en-US">
<% if !defined?(@page_title) %>
<title>In/Out</title>
<% else %>
<title>In/Out - <%= page_title %></title>
<% end %>
<link rel="alternate" type="application/rss+xml" title="Adams Park" href="http://curbwise.com/adams-park/rss" />
<link rel="alternate" type="application/rss+xml" title="Aksarben" href="http://curbwise.com/aksarben/rss" />
<link rel="alternate" type="application/rss+xml" title="Barrington Park" href="http://curbwise.com/barrington-park/rss" />
<link rel="alternate" type="application/rss+xml" title="Bel Air" href="http://curbwise.com/bel-air/rss" />
<link rel="alternate" type="application/rss+xml" title="Bennington" href="http://curbwise.com/bennington/rss" />
<link rel="alternate" type="application/rss+xml" title="Benson North" href="http://curbwise.com/benson-north/rss" />
<link rel="alternate" type="application/rss+xml" title="Benson South" href="http://curbwise.com/benson-south/rss" />
<link rel="alternate" type="application/rss+xml" title="Brookhaven" href="http://curbwise.com/brookhaven/rss" />
<link rel="alternate" type="application/rss+xml" title="Burke" href="http://curbwise.com/burke/rss" />
<link rel
http://curbwise.com/adams-park/rss
http://curbwise.com/aksarben/rss
http://curbwise.com/barrington-park/rss
http://curbwise.com/bel-air/rss
http://curbwise.com/bennington/rss
http://curbwise.com/benson-north/rss
http://curbwise.com/benson-south/rss
http://curbwise.com/brookhaven/rss
http://curbwise.com/burke/rss
http://curbwise.com/candlewood/rss
[{
"_id": {
"$oid": "4ddc16698a21ee2f57000001"
},
"description": "UNL student suffered minor lacerations to his back after a fall.",
"incident_number": "10000002",
"date": "01/01/2010",
"time": "03:13",
"building": "Delta Tau Delta",
"street": "",
#!/bin/bash
# Basic for loop in bash
site_base="http://google.com/";
site_suffix="/amazing_string";
for (( i = 1; i <= 25; i++ ))
do
wget -q -A jpg $site_base$i$site_suffix;
done
require "rubygems"
require "crack"
require "json"
require "sinatra"
require "open-uri"
# (c)2011 Nate Benes
# Curbside JSON server
#
# This program is free software: you can redistribute it and/or modify