| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
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
| def ask_password(message) | |
| HighLine.new.ask(message) do |q| | |
| q.echo = false | |
| end | |
| end |
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
| def embed_url(string) | |
| (match = /^(http|https)\:\/\/www\.youtube\.com\/watch\?v\=(\w*)(\&(.*))?$/i.match(string)) ? "http://www.youtube.com/e/#{match[2]}" : nil | |
| end | |
| puts embed_url( "http://www.youtube.com/watch?v=ONvTNAG2e9c&feature=related") == "http://www.youtube.com/e/ONvTNAG2e9c" | |
| puts embed_url("http://www.youtube.com/watch?v=ONvTNAG2e9c") == "http://www.youtube.com/e/ONvTNAG2e9c" | |
| puts embed_url("http://www.hola.com/watch?v=ONvTNAG2e9c") == "http://www.hola.com/e/ONvTNAG2e9c" |
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
| cache_for :invitiations do |invitation| | |
| invitation(:new) do |action| | |
| action.increase(:create) | |
| action.decrease(:update, :not => :to_pending?) | |
| end | |
| invitation(:accepted) do |action| | |
| action.increase(:to_accepted?) | |
| action.decrease(:update, :not => :to_accepted?) | |
| end | |
| invitation(:rejected) do |action| |
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 'hpricot' | |
| require 'open-uri' | |
| doc = open("http://qwantz.com/") { |f| Hpricot(f) } | |
| doc.search("//body").count |
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
| module Replaceable | |
| def self.include_me!(_class) | |
| _class.class_eval do | |
| include Replaceable | |
| end | |
| end | |
| def replace_values!(locals) | |
| locals.each{ |key, val| self.gsub!("%%#{key.to_s.upcase}%%", val) } | |
| self |
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
| c_cyan=`tput setaf 6` | |
| c_red=`tput setaf 1` | |
| c_green=`tput setaf 2` | |
| c_sgr0=`tput sgr0` | |
| branch_color () | |
| { | |
| if git rev-parse --git-dir >/dev/null 2>&1 | |
| then | |
| color="" |
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 'test_helper' | |
| class DecrypterTest < Test::Unit::TestCase | |
| include InformationCard | |
| def test_should_decrypt_encrypted_xml_token_into_saml_token | |
| decrypter = Decrypter.new( | |
| load_encrypted_information_card('wuaki.xml'),certificates_directory, | |
| '/O=testinformationcardruby.com/CN=*.wuaki.tv') | |
| puts decrypter.decrypt |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.
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
| .wizard | |
| = step(1, 'Inscripció') | |
| = step(2, 'Verificació') | |
| = step(3, 'Pagament') | |
| = step(4, 'Final') |
OlderNewer