Skip to content

Instantly share code, notes, and snippets.

View jguitar's full-sized avatar

Juan F. Pérez jguitar

  • Barkibu
  • Valencia, Spain
View GitHub Profile
@jonah-williams
jonah-williams / default.rb
Created March 16, 2010 23:36 — forked from ezmobius/default.rb
chef recipe to add delayed_job workers to monit to run them on Engine Yard cloud instances
#
# Cookbook Name:: delayed_job
# Recipe:: default
#
node[:applications].each do |app_name, data|
user = node[:users].first
case node[:instance_role]
when "solo", "app", "app_master"
@eteubert
eteubert / rcov.rake
Created April 18, 2011 12:38
A rake task to combine the rcov coverage reports of RSpec and Cucumber
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
namespace :rcov do
rcov_options = %w{
--rails
--exclude osx\/objc,gems\/,spec\/,features\/,seeds\/
--aggregate coverage/coverage.data
}
@stan
stan / 0_instructions.txt
Created May 19, 2011 02:25 — forked from sgruhier/0_instructions.txt
Sprocket 2 in Rails 3.0.x ala Rails 3.1
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript
powered JS and SASS powered CSS with YUI compression all via the magic of rack.
This stuff will be native in Rails 3.1 and the layout of the files on the
filesystem will be different but this guide will get you working with it
while we wait for all that to finalize.
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist.
It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention
@stanislaw
stanislaw / spec_helper.rb
Created February 3, 2012 17:23 — forked from sr75/spec_helper.rb
Example rails 3.1 spec_helper.rb file using spork, rspec, factory_girl, database_cleaner, I18n
require 'spork'
Spork.prefork do
# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect.
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
@coreyhaines
coreyhaines / .rspec
Last active April 11, 2024 00:19
Active Record Spec Helper - Loading just active record
--colour
-I app
@jasoares
jasoares / gist:2217790
Created March 27, 2012 16:42
Ruby Exceptions Hierarchy
Object
+--Exception
+--NoMemoryError
+--ScriptError
| +--LoadError
| +--NotImplementedError
| +--SyntaxError
+--SecurityError # Was a StandardError in 1.8
+--SignalException
| +--Interrupt
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@steveclarke
steveclarke / capybara.md
Created April 10, 2012 17:32
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)
@Fernan2
Fernan2 / Excel.rb
Created May 24, 2012 11:09
Creación de Excels desde Rails
require 'spreadsheet'
include Spreadsheet
format.xls do
# ------ El bloque XLS debe ir sin paginación y con producto ------ #
fichero = "vila_#{@modo}_#{Time.now.to_f.to_s}.xls"
ruta = "#{Rails.root}/tmp/#{fichero}"
Spreadsheet.client_encoding = "UTF-8"
workbook = Spreadsheet::Workbook.new
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 23, 2024 18:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname