Skip to content

Instantly share code, notes, and snippets.

View candidosales's full-sized avatar

Candido Sales Gomes candidosales

View GitHub Profile
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
View capybara cheat sheet
=Clicking links and buttons=
click_link('Link Text')
click('Link Text') # Click either a link or a button
click('Button Value')
notice: "%{resource_name} criado com sucesso."
alert: "* Preencha todos os campos corretamente."
notice: "%{resource_name} foi atualizado com sucesso."
notice: "%{resource_name} foi removido com sucesso."
etagwerker / unicorn.default.rb
Created December 29, 2010 19:39
default unicorn configuration
View unicorn.default.rb
# See for complete
# documentation.
worker_processes 2
# Help ensure your application will always spawn in the symlinked
# "current" directory that Capistrano sets up.
working_directory "/home/deployer/"
# listen on both a Unix domain socket and a TCP port,
# we use a shorter backlog for quicker failover when busy
listen "/tmp/", :backlog => 64
listen 8080, :tcp_nopush => true
JangoSteve / ubuntu_rails_install.rb
Created January 22, 2011 17:58
Capistrano script to install Ruby, RVM, Rails in ubuntu (modified from deploy.rb scripts)
View ubuntu_rails_install.rb
namespace :ubuntu do
desc "Setup Environment"
task :setup_env, :roles => :app do
# Install and setup RVM instead of old Rails stack
lancejpollard /
Created November 28, 2011 01:50
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
matthutchinson / std.js
Created January 20, 2012 17:37
Standard Deviation in Javascript
View std.js
var array = [2, 3, 4, 6, 2, 5, 7, 2, 4, 5, 99];
var within_std_of = 3;
outputResult = function(str) {
var content = $('#results').html();
$('#results').html(content + str);
yaraki / dijkstra.rb
Created February 3, 2012 13:58
Dijkstra Shortest Path Algorithm in Ruby
View dijkstra.rb
#!/usr/bin/ruby1.9.1 -Kw
# -*- coding: utf-8 -*-
class Edge
attr_accessor :src, :dst, :length
def initialize(src, dst, length = 1)
@src = src
@dst = dst
@length = length
gertig / 0_steps
Created March 31, 2012 20:26
VPS Setup and Deployment ( #335)
View 0_steps
When building a new instance of Amazon EC2 choose quick-start-1 as the security group not default
$ capify .
$ chmod +x config/
$ git add .
$ git commit -m "deployment configs"
If rebuilding an instance don't forget to remove the ssh keys
awshout / foundation4-topbar-menu.php
Last active August 19, 2023 02:44
WordPress Menu & Walker for ZURB's Foundation 4 Top Bar
View foundation4-topbar-menu.php
* Register Menus
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
malarkey / Contract Killer
Last active February 29, 2024 20:24
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008