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! CleverTab(type) | |
| if a:type=='omni' | |
| if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' | |
| let g:stop_autocomplete=1 | |
| return "\<TAB>" | |
| elseif !pumvisible() && !&omnifunc | |
| return "\<C-X>\<C-O>\<C-P>" | |
| endif | |
| elseif a:type=='keyword' && !pumvisible() && !g:stop_autocomplete | |
| return "\<C-X>\<C-N>\<C-P>" |
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 strict'; | |
| var express = require('express'), | |
| request = require('superagent'), | |
| app = express(), | |
| config = require('./config'); | |
| app.get('*', function(req, res){ | |
| var cloudfrontUrl = config[req.url]; |
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
| var webpage = require('webpage'), | |
| q = require('sdk/core/promise'); | |
| var page = webpage.create(); | |
| var render = function(){ | |
| page.render("~/google-image.png"); | |
| }; | |
| var modify = 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
| click_on "Add new person" | |
| last_nested_fields = all('.fields').last | |
| within(last_nested_fields) do | |
| fill_in "Name", with: "Ricardo" | |
| fill_in "Age", with: 27 | |
| 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
| RSpec.configure do |config| | |
| config.before(:suite) do | |
| ActiveRecord::Base.observers.disable :all | |
| 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
| sed -i.bkp s/Factory\(\:/FactoryGirl.create\(\:/g spec/**/*.rb | |
| sed -i.bkp s/Factory\ \:/FactoryGirl.create\ \:/g spec/**/*.rb | |
| sed -i.bkp s/Factory\.build\ \:/FactoryGirl.build\ \:/g spec/**/*.rb | |
| sed -i.bkp s/Factory\.build\(\:/FactoryGirl.build\(\:/g spec/**/*.rb | |
| sed -i.bkp s/Factory\.next/FactoryGirl\.generate/g spec/**/*.rb | |
| rm -rf spec/**/*.bkp |
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 Foo | |
| def do_something | |
| ... | |
| Rails.application.routes.url_helpers.my_awesome_routing_path | |
| Rails.application.routes.url_helpers.my_awesome_routing_url(:host => 'http://your-domain.com') | |
| ... | |
| 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
| $(window).konami(function(){ | |
| $(".goku").show(); | |
| $(".goku").delay(2000).fadeOut(); | |
| }); |
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
| desc "Run all tests" | |
| task :build do | |
| system "rm rerun.txt" | |
| raise 'Error on rspec. Fix it, bro' unless system "bundle exec rspec spec" | |
| raise 'Error on cucumber plain. Fix it, bro' unless system "bundle exec cucumber" | |
| 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
| first: brew install highlight | |
| second: add to your .zshrc (or .bashrc) | |
| function hlr { | |
| filename=`echo $1 | cut -d . -f 1` | |
| highlight --syntax ruby -k Menlo -K 20 -O rtf -s edit-xcode $1 > $filename.rtf | |
| } | |
| third: it will generate a .rtf file. just open and copy the highlighted code and add to your Keynote talk. |