Skip to content

Instantly share code, notes, and snippets.

View chrismear's full-sized avatar

Chris Tucker Mear chrismear

View GitHub Profile
[remote "origin"]
url = git://github.com/rails/rails.git
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "origin-blast-it-all-away"]
url = git://github.com/rails/rails.git
fetch = +refs/heads/*:refs/heads/*
Send user to:
http://consent.live.com/Delegation.aspx?RU=[return URL]&ps=Contacts.Invite&pl=[privacy URL]
where [return URL] is your post-back URL, and [privacy URL] is the URL of your privacy policy.
When the user has authenticated and granted your application permission, you receive a post-back which includes the parameter 'ConsentToken'.
Un-URL-encode the ConsentToken parameter to yield a querystring.
Extract the 'eact' parameter from the querystring.
# Create a model to save in-progress ContactSiphon sessions:
# script/generate contact_siphon_sessions
# rake db:migrate
# config/contact_siphon.yml:
windows_live_mail:
return_url: http://www.example.com/windows_live
privacy_policy_url: http://www.example.com/privacy
secret_key: dofinsoiaosdifnaosdnf
@chrismear
chrismear / eat
Created September 19, 2008 13:17
#!/bin/bash
open `curl -s http://www.eat.co.uk/pages/soup.shtml | sed -n 's_^.*\(http://www.eat.co.uk/cgi/eat\_menus/db.cgi?db=default.*Records\).*$_\1_p'`
#!/usr/bin/env perl
if ($ARGV[0] =~ /^dave.*(?<!dog)$/) {
print "YES\n";
} else {
print "NO\n";
}
require 'csv'
codes = []
CSV.open("codes.csv", 'r') do |row|
codes[row[1].to_i] = row[0]
end
Dir.chdir 'export'
wd = Dir.getwd
Registering your application with the service providers:
Google
Primary article: http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html
1. Create an X.509 certificate for your domain, following the instructions here: http://code.google.com/apis/gdata/authsub.html#Registered. Save both the keys file and the certificate file.
2. Sign up for a Google account if you haven't already got an appropriate one: https://www.google.com/accounts/NewAccount
3. Go to the Google Manage Your Domains page: https://www.google.com/accounts/ManageDomains
4. Add a new domain.
5. Click on the 'manage' link for the domain you added.
6. Follow the instructions to verify the domain.
chris$ du -sh .git
27M .git
chris$ git gc --aggressive
Counting objects: 11548, done.
Compressing objects: 100% (10840/10840), done.
Writing objects: 100% (11548/11548), done.
Total 11548 (delta 5021), reused 0 (delta 0)
Removing duplicate objects: 100% (256/256), done.
chris$ du -sh .git
38M .git
# This...
task :my_task do
some_code
end
# becomes this...
task :my_task do
begin
sudo aptitude search mysql | grep "^i"
id libdbd-mysql-perl - A Perl5 database interface to the MySQL da
iB libmysqlclient14 - mysql database client library
iB libmysqlclient14-dev - mysql database development files
id libmysqlclient15off - MySQL database client library
id mysql-client-5.0 - MySQL database client binaries
id mysql-common - MySQL database common files
id mysql-server - MySQL database server (meta package depend
id mysql-server-5.0 - MySQL database server binaries