This file contains 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
# Ride4Ruby solution by Aidan Feldman | |
# [email protected] | |
# contest: http://www.engineyard.com/blog/2011/january-contest-ride4ruby/ | |
# 1/11/10 | |
require 'rubygems' | |
require 'rest_client' | |
require 'active_support' | |
require 'active_support/core_ext' |
This file contains 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 is useful inside of an initializer | |
COUNTRIES = [ | |
["United States", "US"], | |
["Afghanistan", "AF"], | |
["Albania", "AL"], | |
["Algeria", "DZ"], | |
["American Samoa", "AS"], | |
["Andorra", "AD"], | |
["Angola", "AO"], |
This file contains 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
// note: this is not tested, but gives you the idea :-) | |
// for a normal html form: | |
$('form').submit(function(){ | |
$(this).find('input.clear-input').each(function(i, elt){ | |
// for each clear-input field | |
if ($(elt).val() === $(elt).initialValue()) { | |
// value has not changed | |
// empty the value | |
$(elt).val(''); |
This file contains 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
# Parses YouTube URLs directly or from iframe code. Handles: | |
# * Address bar on YouTube url (ex: http://www.youtube.com/watch?v=ZFqlHhCNBOI) | |
# * Direct http://youtu.be/ url (ex: http://youtu.be/ZFqlHhCNBOI) | |
# * Full iframe embed code (ex: <iframe src="http://www.youtube.com/embed/ZFqlHhCNBOI">) | |
# * Old <object> tag embed code (ex: <object><param name="movie" value="http://www.youtube.com/v/ZFqlHhCNBOI">...) | |
/(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/ | |
$5 #=> the video ID | |
# test it on Rubular: http://rubular.com/r/eaJeSMkJvo |
This file contains 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
# Using soloist to set up a new Lion machine | |
# http://pivotallabs.com/users/cunnie/blog/articles/1872-got-lion-now-get-everything-else- | |
cookbook_paths: | |
- ./workspace | |
recipes: | |
- pivotal_workstation::bash_profile-git_completion | |
- pivotal_workstation::bash_profile-ps1 | |
- pivotal_workstation::dropbox | |
- pivotal_workstation::firefox |
This file contains 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
# sing "99 bottles of beer on the wall..." | |
# sing "98 bottles of beer on the wall..." | |
# ...keep counting down... |
This file contains 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
/** | |
* Encapsulates the css for a given bit. Prepends the bit name as an ancestor selector, | |
* as well as a "self" selector for each element and class selector found in a sheet.<br><br> | |
* | |
* For example, given a bit with name "myBit", the sheet: | |
* <pre><code> | |
.myClass { color: blue; } | |
.myOtherClass { color: red; } | |
* </pre></code> | |
* would be converted to: |
This file contains 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
num_ok = 0 | |
users = User.where(:custom_domain => /\S/) | |
users.each do |u| | |
begin | |
records = Net::DNS::Resolver.start(u.custom_domain).answer | |
rescue Net::DNS::Resolver::NoResponseError | |
records = [] | |
end | |
This file contains 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
Aidans-MacBook-Pro:faacelift (master)$ jitsu env set FAACELIFT_FB_APP_ID XXXXXXX | |
info: Welcome to Nodejitsu | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command env set FAACELIFT_FB_APP_ID XXXXXXX | |
info: Authenticated as aidanfeldman | |
error: Error running command env set FAACELIFT_FB_APP_ID XXXXXXX | |
error: Nodejitsu Error (404): Item not found | |
error: request not found | |
info: Nodejitsu not ok |
This file contains 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
very rough estimates - measured with a Canon Rebel T3i | |
------------------------------- | |
bit rates: | |
640x480 30fps -> 1.27 MB/s | |
1920x1080 24fps -> 5.91 MB/s | |
8GB card capacity: |
OlderNewer