Skip to content

Instantly share code, notes, and snippets.

View lucasdavila's full-sized avatar
🌈

Lucas D'Avila lucasdavila

🌈
  • SC, Brasil
View GitHub Profile
@lucasdavila
lucasdavila / setup.sh
Last active March 20, 2017 11:25 — forked from erwanjegouzo/gist:5903791
Dropbox preferences sync
# bash_profile
mv ~/.bash_profile ~/Dropbox/.bash_profile
ln -s ~/Dropbox/.bash_profile ~/.bash_profile
# Sublime 2 Preferences
mkdir -p ~/Dropbox/Library/Application\ Support/Sublime\ Text\ 2/
cd ~/Library/Application\ Support/Sublime\ Text\ 2/
mv ./Installed\ Packages ~/Dropbox/Library/Application\ Support/Sublime\ Text\ 2/Installed\ Packages
mv ./Packages ~/Dropbox/Library/Application\ Support/Sublime\ Text\ 2/Packages
mv ./Pristine\ Packages ~/Dropbox/Library/Application\ Support/Sublime\ Text\ 2/Pristine\ Packages

Capybara

save_and_open_page

Matchers

have_button(locator)
" RSpec
map <Leader>r :call RunTest()<CR>
map <Leader>R :call RunNearestTest()<CR>
function! RunTest()
call RunTestFile(FindTestFile())
endfunction
function! RunNearestTest()
call RunTestFile(FindTestFile() . ':' . line('.'))
@lucasdavila
lucasdavila / Munin Passenger Phusion Memory Stats.rb
Created December 21, 2011 15:18 — forked from jamiew/Munin Passenger Phusion Memory Stats.rb
munin plugin to monitor Passenger Phusion memory stats (adapted for rvm)
#!/usr/bin/env ruby
# put in /etc/munin/plugins and restart munin-node
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats
def output_config
puts <<-END
graph_category App
graph_title Passenger memory stats
graph_vlabel count
@lucasdavila
lucasdavila / passenger_status.rb
Created December 21, 2011 15:18 — forked from dan-manges/passenger_status.rb
munin plugin for passenger (adapted for rvm)
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions
max.label max processes
@lucasdavila
lucasdavila / menu.js
Created October 8, 2011 04:05
Menu JavaScript
function Element(childs, options, tag) {
this.initialize(childs, options, tag);
}
Element.prototype.initialize = function(childs, options, tag) {
this.childs = childs || [];
if (this.childs.constructor != Array)
this.childs = [this.childs];
this.options = options || {};