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
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">] |
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
# add this to your .bash_profile | |
function pow() { | |
name=`basename $PWD` | |
if [[ $1 && $1 != "-ru" ]]; then | |
name=$1 | |
fi | |
echo "Using name: $name" |
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
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 |
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
gem install cucumber webrat | |
./script/generate cucumber --test-unit |
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
require 'digest/sha1' | |
sha1 = Digest::SHA1.hexdigest('something secret') |
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
$.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); |
NewerOlder