Skip to content

Instantly share code, notes, and snippets.

Avatar

Tiago Franco gamafranco

View GitHub Profile
View gist:1071498
def fill_box(asset, selected, selected_class)
items = asset.map { |item| item.id } if asset.is_a?(Array)
items ||= [asset.id]
output = items.map ...
output.html_safe
end
View gist:5172694
[2013-03-15T19:58:52+00:00] INFO: Processing execute[a2enmod passenger] action run (passenger_apache2::default line 38)
================================================================================
Error executing action `run` on resource 'execute[a2enmod passenger]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /usr/sbin/a2enmod passenger ----
View rvm-unload.sh
# functions and variables
unset $(set | awk -F"[= ]" '/^\w*(RUBY|GEM|IRB|rvm|gem|rubies)\w*(=| \(\))/ {print $1}')
# aliases
unalias $(alias | awk -F"[= ]" '/rvm/ {print $2}')
# others
unset cd file_exists_at_url popd pushd
# PATH
@gamafranco
gamafranco / screenshot.rb
Last active Oct 17, 2018 — forked from asbubam/screenshot.rb
webkit screen capture using by capybara-webkit gem
View screenshot.rb
#!/usr/bin/env ruby
require 'capybara-webkit'
require 'headless'
urls = [
'https://www.linkedin.com/feed/update/urn:li:activity:6445944267885154304/',
'https://www.bbc.com/news/technology-45546275',
'https://twitter.com/theipaper/status/1046784302006976512',
'https://twitter.com/DailyMailUK/status/1047014074561847296',
'https://www.dailymail.co.uk/news/article-6229029/Now-sale-UK-high-protein-meal-glass-health-drink.html',