Skip to content

Instantly share code, notes, and snippets.

View johndbritton's full-sized avatar

John Britton johndbritton

View GitHub Profile
@johndbritton
johndbritton / Command Log
Created October 25, 2012 00:53
Git + GitHub at Virginia Tech
mkdir vt
cd vt
ls -alh
git init
ls -ahl
cd .git/
ls
rm -rf hooks
cd vt/.git/
tree
@johndbritton
johndbritton / Gemfile
Created October 1, 2012 01:08
Google calendar to KML
source :rubygems
gem 'dotenv', :groups => [:development, :test]
gem "nokogiri"
gem "geocoder"
@johndbritton
johndbritton / university_events.kml
Created September 24, 2012 20:08
University Events KML Example
<?xml version="1.0"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<name>Git / GitHub Session at NYU - Tech@NYU HackDays</name>
<description>Git / GitHub Session at NYU - Tech@NYU HackDays</description>
<Point>
<coordinates>-74.00597309999999,40.7143528</coordinates>
</Point>
</Placemark>
When the Master governs, the people
are hardly aware that he exists.
Next best is a leader who is loved.
Next, one who is feared.
The worst is one who is despised.
If you don't trust the people,
you make them untrustworthy.
The Master doesn't talk, he acts.
@johndbritton
johndbritton / gist:1858678
Created February 18, 2012 10:40
Output of bundle install, error with sqlite3
redblack:spreadreach john$ bundle install
Fetching source index for http://rubygems.org/
Using i18n (0.6.0)
Using multi_json (1.0.4)
Using activesupport (3.2.1)
Using addressable (2.2.7)
Using bcrypt-ruby (3.0.1)
Using dm-core (1.2.0)
Using dm-aggregates (1.2.0)
Using dm-constraints (1.2.0)
@johndbritton
johndbritton / config.ru
Created July 12, 2011 20:08
Example rackup file for serving static content with Heroku.
use Rack::Static, :urls => ["/css", "/images"], :root => "public"
run lambda { |env| [200, { 'Content-Type' => 'text/html', 'Cache-Control' => 'public, max-age=86400' }, File.open('public/index.html', File::RDONLY)] }
require 'rubygems'
require 'sinatra'
require 'builder'
require 'sunlight'
set :sunlight_key, ENV['sunlight_key']
post '/' do
builder :welcome
end
@johndbritton
johndbritton / Textipedia.php
Created January 14, 2011 23:31
Wikipedia via SMS
<?php
header('Content-type: text/xml');
$url = "http://en.wikipedia.org/w/api.php?action=parse&format=xml&prop=sections&page=".$_POST['Body'];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, "Textipedia");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
redblack:paperworks john$ rake
(in /Users/john/Sites/toys/paperworks)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby test/tests.rb
Loaded suite test/tests
Started
........
Finished in 0.001337 seconds.
8 tests, 16 assertions, 0 failures, 0 errors
<?php
/**
* "The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations