Skip to content
View config.json
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
View foo_delayed_job_production.conf
# /etc/monit/conf.d/avialable/foo_delayed_job_production.conf
# Monit configuration for Delayed Job
# Delayed job for app foo running as deploy in environment production
# Service name: foo_production_delayed_job
check process foo_production_delayed_job
# Checking for a pidfile
View gist:9462906
# config/initializers/clear_dev_logs.rb
# This snippet simply clears your logs when they are too large.
# Large logs for development are usually something you don't want.
# Every time you run rails server or rails console it checks the size
# of your development logfile and truncates it.
if Rails.env.development?
MAX_LOG_SIZE = 1.megabytes
DEV_LOG_FILE = File.join(Rails.root, 'log', 'development.log')
View get_dot_notation.rb
# Get dot notification for the current mongoid element
def dot_notation_for_element(element)
return "" if element.nil?
dot_notation = dot_notation_for_element_nested(element)
if dot_notation.nil?
return ""
dot_notation[0] = ''
View gist:6448361
sudo apt-get install libfontconfig1
cd /usr/local/share/
tar xjf phantomjs-1.9.1-linux-x86_64.tar.bz2
rm -f phantomjs-1.9.1-linux-x86_64.tar.bz2
ln -s phantomjs-1.9.1-linux-x86_64 phantomjs
sudo ln -s /usr/local/share/phantomjs/bin/phantomjs /usr/bin/phantomjs
phantomjs --version
View devise_async_delayed_job_i18n.rb
require 'devise/async'
require 'devise/async/backend/base'
require 'devise/async/backend/delayed_job'
if defined?(Devise::Async::Backend::Base) && defined?(Devise::Async::Backend::DelayedJob)
module Devise
module Async
module Backend
class Base
def perform_with_locale(method, resource_class, resource_id, opts, locale)
View async_emails_i18n.rb
require 'resque_mailer'
require 'devise/async'
# pop and set locale from the args before running
module PerformWithLocale
def perform(*args)
I18n.with_locale(args.pop) do
View gist:6238842
{bitcask, [
{max_file_size, 268435456}, %% maximum 256 mb files
{frag_merge_trigger, 35}, %% fragmentation >= 35%
{dead_bytes_merge_trigger, 134217728}, %% dead bytes > 128 MB
{frag_threshold, 20}, %% fragmentation >= 20%
{dead_bytes_threshold, 33554432}, %% dead bytes > 32 MB
{small_file_threshold, 10485760}, %% file is < 10MB
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
%% Riak Client APIs config
{riak_api, [
%% pb_backlog is the maximum length to which the queue of pending
%% connections may grow. If set, it must be an integer >= 0.
%% By default the value is 5. If you anticipate a huge number of
%% connections being initialised *simultaneously*, set this number
%% higher.
View leifcr.zsh-theme
#!/usr/bin/env zsh
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
setopt promptsubst
autoload -U add-zsh-hook
Something went wrong with that request. Please try again.