Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Customer Reset Password email
*
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 2.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
set :shared_children, shared_children << 'tmp/sockets'
namespace :deploy do
desc "Start the application"
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && RAILS_ENV=#{stage} bundle exec puma -b 'unix://#{shared_path}/sockets/puma.sock' -S #{shared_path}/sockets/puma.state --control 'unix://#{shared_path}/sockets/pumactl.sock' >> #{shared_path}/log/puma-#{stage}.log 2>&1 &", :pty => false
end
desc "Stop the application"
task :stop, :roles => :app, :except => { :no_release => true } do
/**
* supplant() does variable substitution on the string. It scans through the string looking for
* expressions enclosed in { } braces. If an expression is found, use it as a key on the object,
* and if the key has a string value or number value, it is substituted for the bracket expression
* and it repeats.
*
* Written by Douglas Crockford
* http://www.crockford.com/
*/
String.prototype.supplant = function (o) {
@eveevans
eveevans / README.md
Created September 12, 2013 18:38 — forked from netmute/README.md

Game of Life

An implementation of Conway's Game of Life in 140 characters of Ruby.

Author

Created by Simon Ernst (@sier).

@eveevans
eveevans / gist:6530487
Created September 11, 2013 22:10
Person in ....
# current_account.posts.visible_to(current_user)
module Visible
extend ActiveSupport::Concern
module ClassMethods
def visible_to(person)
where \
"(#{table_name}.bucket_id IN (?) AND
#{table_name}.bucket_type = 'Project') OR
(#{table_name}.bucket_id IN (?) AND
@eveevans
eveevans / gist:6529318
Created September 11, 2013 20:27
TurboBla
$(function() {
initPage();
});
$(window).bind('page:change', function() {
initPage();
})
@eveevans
eveevans / gist:6300736
Created August 21, 2013 21:54
Ruby dependencies for Ubuntu
apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev
@eveevans
eveevans / gist:4128132
Created November 21, 2012 21:56
Put 'unicorn' proccess on the system start up
sudo update-rc.d unicorn defaults
@eveevans
eveevans / gist:4075479
Created November 14, 2012 23:03
Ruby Debugger with RVM and Ruby 1.9.3
rvmsudo gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-head/
@eveevans
eveevans / gist:3430445
Created August 22, 2012 23:07
Reveal Password
javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("No password form :(.");})();