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 | |
require_once './sdk.class.php'; // http://aws.amazon.com/sdkforphp/ | |
define('VERIFIED_FROM_EMAIL_ADDRESS', '[email protected]'); | |
define('VERIFIED_TO_EMAIL_ADDRESS', '[email protected]'); | |
$ses = new AmazonSES(AWS_KEY, AWS_SECRET_KEY); | |
var_dump($ses->send_email(VERIFIED_FROM_EMAIL_ADDRESS, | |
array('ToAddresses' => VERIFIED_TO_EMAIL_ADDRESS), | |
array( |
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 | |
require_once 'Zend/Service/Twitter.php'; | |
$me = 'zuzara'; | |
$accessToken = new Zend_Oauth_Token_Access; | |
$accessToken->setToken('***') | |
->setTokenSecret('***'); // grab them at https://dev.twitter.com/apps/***/my_token | |
$twitter = new Zend_Service_Twitter(array( |
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
#!/usr/local/bin/php | |
<?php | |
$lines = array_reverse(file($argv[1])); | |
array_walk($lines, function($value, $key){ | |
echo $value; | |
}); |
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
function bold($str) | |
{ | |
return chr(27) . "[1m" . $str . chr(27) . "[0m"; | |
} |
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$('div').one('click', function(){ | |
console.log('div is clicked.'); | |
}); | |
//$('span').bind('click', function(){ | |
$('span').live('click', function(){ |
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
wget https://raw.github.com/niw/homebrew/master/Library/Formula/vim.rb | |
easy_install mercurial | |
brew install /usr/local/Library/Formula/vim.rb |
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
angular.module('test', []) | |
.directive('placeholder', function($timeout){ | |
if (!$.browser.msie || $.browser.version >= 10) { | |
return {}; | |
} | |
return { | |
link: function(scope, elm, attrs){ | |
if (attrs.type === 'password') { | |
return; | |
} |
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
# Kind of fork from https://github.com/jgoodall/us-maps | |
# | |
# Access http://www.census.gov/cgi-bin/geo/shapefiles2013/main | |
# Choose 'States (and equivalent)' and 'Submit' | |
mkdir tl_2013_us_state | |
cd tl_2013_us_state | |
mkdir topojson geojson | |
unzip ../tl_2013_us_state.zip | |
ogr2ogr -f "GeoJSON" geojson/state.json tl_2013_us_state.shp tl_2013_us_state | |
topojson --id-property STUSPS --out topojson/state.json geojson/state.json |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Switch Input Method to Expose key</name> | |
<appendix>Ctrl-3 to the Expose key (F3)</appendix> | |
<identifier>remap.input_method_to_fkeys_f3</identifier> | |
<autogen>__KeyToKey__ KeyCode::EXPOSE_ALL, KeyCode::KEY_3, ModifierFlag::CONTROL_L</autogen> | |
</item> | |
</root> |
OlderNewer