Part of a series of examples. See:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> | |
<script type="text/javascript"> | |
var addresses = [ ], // Addresses you want matched | |
fixed = [ ], // Where they'll get put eventually | |
g = new google.maps.Geocoder | |
function newAddress(address) { | |
var theaddress = address || addresses.shift() | |
function newAddress(address) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use a simple jQuery GET request to get the data from export and return it to myQuery variable | |
$.get( | |
'http://hq-salsa.wiredforchange.com/dia/hq/export.jsp?', | |
{ 'query_KEY': 196951, 'type':'csv','include':'supporter_KEY,First_Name,Last_Name,Email'}, | |
function(result) { myQuery = csvImport( result ); } | |
) | |
// Here's a function to parse the CSV and return the results as objects - using the first row as a name sequence | |
function csvImport( blob ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# First install https://github.com/facebook/phpsh | |
# And ctags https://github.com/mxcl/homebrew/blob/master/Library/Formula/ctags.rb | |
# From http://vocecommunications.com/blog/2010/12/how-to-setup-an-interactive-wordpress-shell/ | |
if [ ! -f ./.wp-shell.php ]; | |
then | |
echo '<?php include_once("wp-load.php"); include_once("wp-admin/includes/admin.php"); ?>' > ./.wp-shell.php | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function add_my_script() { | |
wp_enqueue_script( | |
'my-script', // The name of your script | |
get_stylesheet_directory_uri().'/my-script.js', // Your script | |
array('jquery') // Dependencies - so it knows to put your script AFTER jQuery | |
); | |
} | |
add_action('wp_enqueue_scripts', 'add_my_script'); // The action that will add your script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/> | |
<script src="http://cmx.io/v/0.1/cmx.js"></script> | |
<body> | |
<scene id="scene1"> | |
<label t="translate(0,346)"> | |
<tspan x="0" y="0em">Comix Sample</tspan> | |
</label> | |
<actor t="translate(150,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|-6,79|-1,59"> |
Part of a series of examples. See:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this script will install whisper, carbon and graphite-web on the current directory | |
# Modified to reflect current WebFaction python best practices | |
mkdir -p $HOME/lib/python2.7 | |
# Follow steps here http://theneum.com/blog/webfaction-virtualenv-how-to/ | |
easy_install-2.7 pip | |
pip-2.7 install virtualenvwrapper | |
mkdir ~/.virtualenvs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* based off of tinyxhr by Shimon Doodkin - license: public doamin - https://gist.github.com/4706967 | |
Added ontop of Simon's code: | |
- Serialization of the object | |
- Moved some arguments to line up with jQuery( url, data, callback ) | |
- Will attempt to parse JSON from the response if it's valid JSON | |
- Added a tinyPost and tinyGet method | |
Some other things that'd be good: | |
- Seprate error callback for failed responses |
Use these handy functions to find congessional targets by zip code. AND optionally filter those members by setting:
- A target chamber - e.g.
House
orSenate
- A target party - e.g.
D
orR
- A list of target senators - either an array of names
["Ted Cruz","Mitch McConnell"]
, twitter handles["SenTedCruz","McConnellPress"]
, or Bioguide IDs["B001282","C001098"]
Will return an empty Sunglight API Call { results: [ ], count: 0 }
if there are no results after the filter.