Skip to content

Instantly share code, notes, and snippets.

Pete Nicholls Aupajo

Block or report user

Report or block Aupajo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Aupajo
Aupajo / gist:139093
Created Jul 1, 2009 — forked from gabe/gist:137356
Possible implementation of Sinatra URI templates?
View gist:139093
require 'addressable/template'
module Juxt
module Sinatra
# Allows for declared, named URI Templates in Sinatra applications,
# for both routing and URI generation.
#
# The URI generation method (included as a Sinatra helper) modifies
# the path of generated URIs with request.script_name, meaning the
# URIs generated will still be valid if multiple Sinatra applications
View twat.rb
#!/usr/bin/env ruby
# Find common Twitter friends
# Usage: ./twat.rb user1 user2 ...
lists = ARGV.inject({}) do |hash, username|
page = 0
while !(output = `curl -s http://twitter.com/statuses/friends/#{username}.xml?page=#{page += 1} | grep "<screen_name>"`.gsub(%r{</?screen_name>}, '').split).empty?
hash[username] = ((hash[username] || []) + output).sort
end
hash
@Aupajo
Aupajo / gist:61649
Created Feb 10, 2009 — forked from anonymous/gist:61647
Top used commands
View gist:61649
history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr
83 nano
55 git
47 ssh
47 ghproxy
47 cd
36 ls
24 ping
19 sudo
View github-code-search.js
// Based on apidock.org Ubiquity Search: http://gist.github.com/8132
CmdUtils.CreateCommand(
{
name: "github",
takes: {"function": noun_arb_text},
icon: "http://github.com/fluidicon.png",
homepage: "http://tiago.zusee.com",
author: {name: "Tiago Bastos", email: "comechao@gmail.com"},
license: "MPL,GPL",
description: "Search on Github Code Search",
You can’t perform that action at this time.