Skip to content

Instantly share code, notes, and snippets.

View jrub's full-sized avatar
🏠
Working from home

Javi Rubio jrub

🏠
Working from home
View GitHub Profile
@everzet
everzet / AppKernel.php
Created June 27, 2011 12:07
How to configure BehatBundle and MinkBundle to run goutte sessions efficiently
<?php
public function registerBundles()
{
// ...
if ('test' === $this->getEnvironment()) {
$bundles[] = new Behat\MinkBundle\BehatMinkBundle();
$bundles[] = new Behat\BehatBundle\BehatBundle();
}
// ...
@prestarocket
prestarocket / prestashop gitignore
Created July 8, 2011 00:43
Prestashop gitignore
# This is a template .gitignore file for git-managed Prestashop projects. Inspired by micahwalter wordpress gitignore
#Ignore ds_store
*.DS_Store
# Ignore everything in the root except modules, themes and override.
/*
!modules/
!themes/
@benedikt
benedikt / rails.rb
Created July 30, 2011 13:16
Capistrano task to open a rails console on a remote server. Require this file in your deploy.rb and run "cap rails:console"
# encoding: UTF-8
Capistrano::Configuration.instance(:must_exist).load do
namespace :rails do
desc "Open the rails console on one of the remote servers"
task :console, :roles => :app do
hostname = find_servers_for_task(current_task).first
exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && #{current_path}/script/rails c #{rails_env}'"
end
end
@CHH
CHH / .gitignore
Created August 2, 2011 21:09
PHP Templating Engine with bindable $this support in 53 LOC
vendor/
composer.lock
@everzet
everzet / FeatureContext.php
Created August 13, 2011 15:00
How to use MinkContext inside BehatBundle as subcontext
<?php
namespace Acme\DemoBundle\Features\Context;
use Behat\BehatBundle\Context\BehatContext,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
/**
@havvg
havvg / bdd-experiment-guide.md
Created September 9, 2011 14:44
Behavior Driven Development in Symfony2 with Behat, Mink and Zombie.js
@antonrogov
antonrogov / gist:1216347
Created September 14, 2011 11:21
Ruby Coding Guidelines

Ruby Coding Guidelines

Formatting

  • Use UTF-8 as the source file encoding.
  • Use 2 space indent, no tabs. (Your editor/IDE should have a setting to help you with that)
  • Use Unix-style line endings. (Linux/OSX users are covered by default, Windows users have to be extra careful)
    • if you're using Git you might want to do this $ git config --global core.autocrlf true to protect your project from Windows line endings creeping into your project
  • Use spaces around operators, after commas, colons and semicolons, before { and }.
@darcyclark
darcyclark / gist:1384630
Created November 22, 2011 01:38
sending emails asynchronously from Padrino via Resque
# put this in /lib/resque.rb
require 'mail'
module Emailer
class Send
@queue = :issue_mailer
def self.perform(addressee, subject, body)
@doubleo2
doubleo2 / config
Created November 24, 2011 05:26
Solarized palette for Terminator terminal emulator
# Save this file as config (no extension)
# in the ~/.config/terminator/ folder
# if it already exists, copy and paste palette,
# foreground_color and background_color into the
# profile section of your choosing.
[global_config]
[keybindings]
[profiles]
[[default]]
@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts