Skip to content

Instantly share code, notes, and snippets.

View phcostabh's full-sized avatar
🧑‍💻
Coding

Philippe Santana Costa phcostabh

🧑‍💻
Coding
View GitHub Profile
@phcostabh
phcostabh / nginx_rails_3_1
Created September 9, 2012 14:18 — forked from shapeshed/nginx_rails_3_1
Nginx Config for Rails 3.1 with Unicorn and Asset Pipeline
upstream app {
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name www.app.com;
rewrite ^/(.*) http://app.com/$1 permanent;
}
@phcostabh
phcostabh / gist:3698990
Created September 11, 2012 14:22
Capitrano deployment file for zero downtime deploy with Unicorn and Nginx
require "bundler/capistrano"
set :scm, :git
set :repository, "git@repository.com:application.git"
set :branch, "develop"
set :migrate_target, :current
set :ssh_options, { :forward_agent => true }
set :rails_env, "production"
set :deploy_to, "/home/deployer/apps/application"
set :normalize_asset_timestamps, false
@phcostabh
phcostabh / capybara cheat sheet
Created October 15, 2012 23:14 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@phcostabh
phcostabh / zsh.md
Created October 18, 2012 00:53 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh

and then you change your shell to zsh

chsh -s `which zsh`

and then restart

@phcostabh
phcostabh / fb-album.css
Created November 23, 2012 14:04 — forked from stevedev/fb-album.css
Simple jQuery Facebook Album Script
#photo-container {
padding: 15px;
}
#photo-container a {
overflow: hidden;
display: block;
float: left;
border: 1px solid #cdcac6;
padding: 0;
@phcostabh
phcostabh / ControllerTestCase.php
Last active January 1, 2019 07:21
Functional Testing with Laravel using regular HTTP requests and Ajax requests
<?php
/**
* Controller Test Case
*
* Provides some convenience methods for testing Laravel Controllers.
*
* @author Joseph Wynn <joseph@wildlyinaccurate.com>
*/
abstract class ControllerTestCase extends PHPUnit_Framework_TestCase
@phcostabh
phcostabh / setup.sh
Last active December 15, 2015 09:09 — forked from mrsweaters/setup.sh
#!/usr/bin/env bash
# login as root and run this script via bash & curl:
sudo apt-get update
sudo apt-get install -y build-essential bison openssl libreadline5 libreadline5-dev curl \
git-core zlib1g zlib1g-dev libopenssl-ruby libcurl4-openssl-dev libssl-dev \
libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev \
mysql-client mysql-server
@phcostabh
phcostabh / autotest.rb
Last active December 15, 2015 21:38
Autotesting in Laravel 3 with Watchr
watch("application/tests/.*.test.php") do |match|
run_test match[0]
end
def run_test(file)
unless File.exists?(file)
puts "#{file} dos not exist"
return
end
set :application, "App Name" # Your app name
set :repository, "git@github.com:xxxxx/xxx.git" # Your git repository
set :document_root, "/home/user/www/awesome_app"
set :deploy_via, :remote_cache
# SSH Settings
set :user, "user_ssh"
set :password, "password_ssh"
set :use_sudo, false
@phcostabh
phcostabh / Vagrant.rb
Created May 1, 2013 15:19
Vagrant File
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"