Install
- Command Line Tools for Xcode
- Kenneth Reitz's OSX GCC Installer
Install with this line
$.fn.dataset = function(key, value) { | |
if(value != null) { | |
if($(this).attr('data-' + key)) { | |
$(this).attr('data-' + key, value); | |
return true; | |
} else { | |
return false; | |
} | |
} else { | |
return $(this).attr('data-' + key); |
require 'digest/sha1' | |
sha1 = Digest::SHA1.hexdigest('something secret') |
gem install cucumber webrat | |
./script/generate cucumber --test-unit |
class Streamsend::Blast < ActiveResource::Base | |
self.site = "https://app.streamsend.com/" | |
self.user = "{login_id}" | |
self.password = "{key}" | |
self.element_name = "blast" | |
private | |
# fix because streamsend rarely includes the type="array" attribute |
# add this to your .bash_profile | |
function pow() { | |
name=`basename $PWD` | |
if [[ $1 && $1 != "-ru" ]]; then | |
name=$1 | |
fi | |
echo "Using name: $name" |
tmpl = Liquid::Template.parse("I've just liked @{{idea_owner}} idea on Rusic at {{link}}") | |
tmpl.root.nodelist | |
=> ["I've just liked @", #<Liquid::Variable:0x10301f050 @filters=[], @name="idea_owner", @markup="idea_owner">, " idea on Rusic at ", #<Liquid::Variable:0x10301ed80 @filters=[], @name="link", @markup="link">] |
Install
Install with this line
<SERVER IN FRANCE>@ns390706:~$ wget eventbrite.com
--2012-04-12 17:00:28-- http://eventbrite.com/
Resolving eventbrite.com... 184.73.240.63, 50.16.194.113, 50.17.185.155, ...
Connecting to eventbrite.com|184.73.240.63|:80... connected.
HTTP request sent, awaiting response... 301 MOVED PERMANENTLY
Location: http://www.eventbrite.com/ [following]
--2012-04-12 17:00:29-- http://www.eventbrite.com/
Resolving www.eventbrite.com... 50.16.194.113, 50.17.185.155, 50.17.189.7, ...
Connecting to www.eventbrite.com|50.16.194.113|:80... connected.
HTTP request sent, awaiting response... 302 FOUND
# $.esc | |
# Binds the given callback function to the keyup | |
# event for the "Escape" key | |
# Example usage: | |
# $.esc(function(event) { | |
# alert("Escape key pressed!"); | |
# }); | |
# Compatible with jQuery or Zepto | |
$.esc = (callback) -> | |
$(document).on 'keyup', (event) -> |
https://github.com/styleguide | |
https://github.com/styleguide/ruby | |
https://github.com/bbatsov/ruby-style-guide | |
https://github.com/bbatsov/rails-style-guide | |
https://github.com/copycopter/style-guide | |
https://github.com/polarmobile/coffeescript-style-guide |