Skip to content

Instantly share code, notes, and snippets.

View timwhite47's full-sized avatar

Tim White timwhite47

View GitHub Profile
@timwhite47
timwhite47 / Bellingham WA
Created June 20, 2011 20:23
State Legislator Geo Lookup
http://openstates.sunlightlabs.com:80/api/v1/legislators/geo/?long=48.75235&lat=-122.471219&apikey=MYAPIKEY
@timwhite47
timwhite47 / gist:1241557
Created September 26, 2011 03:33
Returned Geodata
# Returned Geodata for Vancouver, BC
[{"long_name"=>"Vancouver", "short_name"=>"Vancouver", "types"=>["locality", "political"]}, {"long_name"=>"Greater Vancouver Regional District", "short_name"=>"Greater Vancouver Regional District", "types"=>["administrative_area_level_2", "political"]}, {"long_name"=>"British Columbia", "short_name"=>"BC", "types"=>["administrative_area_level_1", "political"]}, {"long_name"=>"Canada", "short_name"=>"CA", "types"=>["country", "political"]}]
@timwhite47
timwhite47 / gist:1877960
Created February 21, 2012 18:23
pushing to heroku cedar
Kadin-Air:pledgie Tim$ git push heroku master
Counting objects: 47, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (29/29), done.
Writing objects: 100% (29/29), 2.64 KiB, done.
Total 29 (delta 25), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.1.rc.7
@timwhite47
timwhite47 / hacktastic.html
Created April 13, 2012 18:48
PledgeMatic HTML/CSS/JS Hacktisms
Hello World
<style type="text/css" media="screen">
body {
/* The Tab's background color */
background-color: red;
}
#tab-content {
/* The main tab conainer */
background-image: url('http://media.smashingmagazine.com/images/textures/texture-1.jpg');
@timwhite47
timwhite47 / fb_like.js
Created July 11, 2012 19:22
fb like in backbone
// Set the big things
window.tab = new Tab({id: <%= @org.fb_page_id %> });
var resp = <%= @resp.to_json.html_safe %>;
// Log if someone has already like the page
function pageLike () {
activities = new Activities(window.tab);
activities.create({
action_id: <%= @org.like_action.try(:id) %>,
organization_id: <%= @org.id %>,
scope :non_system, lambda{ joins(:action).where("action_type_id != ?", ActionType.find_by_opengraph_action('like').id)}
Delivered-To: timwhite47@gmail.com
Received: by 10.194.24.99 with SMTP id t3csp353238wjf;
Tue, 24 Jul 2012 16:09:04 -0700 (PDT)
Received: by 10.229.135.20 with SMTP id l20mr10146858qct.83.1343171344323;
Tue, 24 Jul 2012 16:09:04 -0700 (PDT)
Return-Path: <demo@pledgematic.com>
Received: from ip-10-46-57-122.ec2.internal (ec2-107-20-35-89.compute-1.amazonaws.com. [107.20.35.89])
by mx.google.com with ESMTPS id dt6si12824749qab.31.2012.07.24.16.09.03
(version=TLSv1/SSLv3 cipher=OTHER);
@timwhite47
timwhite47 / o_fuck
Created August 6, 2012 23:25
o fuck
Kadin-Mini:pledgie tim$ STAGING=true cap deploy
"___________STAGING___________"
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:bellport/pledgie.git salesforce"
command finished in 2443ms
* executing "if [ -d /srv/actionsprout/shared/cached-copy ]; then cd /srv/actionsprout/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 792545333de6d1813deea155237ba262b91b8130 && git clean -q -d -x -f; else git clone -q git@github.com:bellport/pledgie.git /srv/actionsprout/shared/cached-copy && cd /srv/actionsprout/shared/cached-copy && git checkout -q -b deploy 792545333de6d1813deea155237ba262b91b8130; fi"
@timwhite47
timwhite47 / capybara cheat sheet
Created October 8, 2012 22:54 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@timwhite47
timwhite47 / arduino_multibyte_serial_example.cpp
Created October 9, 2012 04:21 — forked from fairchild/arduino_multibyte_serial_example.cpp
Simple updated examples of arduino serial communications
/* ------------------------------------------------
* SERIAL COM - HANDELING MULTIPLE BYTES inside ARDUINO - 03_function development
* by beltran berrocal
*
* this prog establishes a connection with the pc and waits for it to send him
* a long string of characters like "hello Arduino!".
* Then Arduino informs the pc that it heard the whole sentence
*
* the same as examlpe 03 but it deploys 2 reusable functions.
* for doing the same job.