Skip to content

Instantly share code, notes, and snippets.

View LucasArruda's full-sized avatar
🎯
Focusing

Lucas Arruda LucasArruda

🎯
Focusing
View GitHub Profile
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
##
## available environments
##
task :production do
set :application, 'myapp.com'
set :repository, 'https://github.com/user/project.git'
@sohara
sohara / table cell locator.rb
Created February 2, 2011 18:48
step definition to test the contents of specific table row given a column heading and the contents of one of the cells in the row
# Locates a table cell based on given row and column content.
When /^(.*) in the "([^\"]*)" column of the "([^\"]*)" row$/ do |action, column_title, row_title|
col_number = 0
all(:xpath, "//*[(th|td)/descendant-or-self::*[contains(text(), '#{column_title}')]]/th").each do |element|
col_number += 1
break if element.has_content?(column_title)
end
within :xpath, "//*[(th|td)/descendant-or-self::*[contains(text(), '#{row_title}')]]/td[#{col_number}]" do
When action
end
#!/usr/bin/env bash
# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
environment_id="ruby-1.9.3-p0@railsapp"
#
# Uncomment following line if you want options to be set only for given project.
@mattfinlayson
mattfinlayson / gist:1530870
Created December 29, 2011 01:01
iconv errors running jekyll on os x
rake generate
## Generating Site with Jekyll
directory source/stylesheets/
create source/stylesheets/screen.css
/Users/BLARG/.rvm/gems/ruby-1.9.2-p290/gems/maruku-0.6.0/lib/maruku/input/parse_doc.rb:22:in `require': no such file to load -- iconv (LoadError)
from /Users/BLARG/.rvm/gems/ruby-1.9.2-p290/gems/maruku-0.6.0/lib/maruku/input/parse_doc.rb:22:in `<top (required)>'
from /Users/BLARG/.rvm/gems/ruby-1.9.2-p290/gems/maruku-0.6.0/lib/maruku.rb:85:in `require'
from /Users/BLARG/.rvm/gems/ruby-1.9.2-p290/gems/maruku-0.6.0/lib/maruku.rb:85:in `<top (required)>'
from /Users/BLARG/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll.rb:26:in `require'
from /Users/BLARG/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll.rb:26:in `<top (required)>'
@klauswuestefeld
klauswuestefeld / gist:1595701
Created January 11, 2012 17:22
O Ciclo Vicioso Do Software Retranqueiro
We couldn’t find that file to show.
@joel
joel / redis.rb
Created April 14, 2012 16:11
config/initializers/redis.rb
class MockRedis
attr_accessor :store
def initialize
@store = {}
end
def flushall
@store = {}
end
@mattdesl
mattdesl / about.md
Last active May 27, 2020 14:10
sublime lint auto save hack

quick hack to explore auto-saving on lint-free code

Using SublimeLint3

Sublime Text -> Preferences -> Browser Packages Open sublimelinter.py in Sublime.

Seek to the highlight method (Cmd + R)

replace with function (see below)

@johanneswuerbach
johanneswuerbach / rails-vagrant-provision.sh
Last active June 29, 2020 19:24
Provision a vagrant box with ruby stable (using rvm), postgres, redis and node (using nvm)
#!/usr/bin/env bash
sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8
sudo apt-get update
sudo apt-get install -y build-essential git curl libxslt1-dev libxml2-dev libssl-dev
# postgres
@fnando
fnando / giffy
Last active July 1, 2020 02:30
Export video files as GIF
#!/usr/bin/env bash
if [[ ! -f "$1" ]]; then
echo "=> Movie file not found"
exit 1
fi
tempfile=/tmp/output.gif
rm -f $tempfile
@shadowmaru
shadowmaru / slides.md
Last active November 26, 2020 07:17
Palestras da RubyConf BR 2017