This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyProject | |
module Mongoid | |
module Document | |
extend ActiveSupport::Concern | |
included do | |
include ::Mongoid::Document | |
include ::Mongoid::Timestamps | |
include ::Mongoid::DotNotation | |
include ::Mongoid::SearchForObject | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Echo off | |
set "inkscapePath=C:\Program Files\Inkscape\inkscape.exe" | |
set /a count=0 | |
set validInput1=svg | |
set validInput2=emf | |
set validInput3=wmf | |
set validOutput1=eps | |
set validOutput2=pdf | |
set validOutput3=png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_debugger(clazz, method) | |
debugger_method = binding.respond_to?(:pry) ? 'binding.pry' : 'byebug' | |
unless clazz.method_defined? "#{method}_with_debugger" | |
clazz.class_eval <<-CODE, __FILE__, __LINE__ + 1 | |
def #{method}_with_debugger(*args, &block) | |
#{debugger_method} | |
#{method}_without_debugger(*args, &block) | |
end | |
alias_method_chain :#{method}, :debugger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libfontconfig1 | |
cd /usr/local/share/ | |
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Raven.js Config --> | |
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
// Ignore list based off: https://gist.github.com/1878283 | |
var ravenOptions = { | |
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion. | |
// See: https://github.com/getsentry/raven-js/issues/73 | |
ignoreErrors: [ | |
// Random plugins/extensions | |
'top.GLOBALS', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 "" | |
else | |
dot_notation[0] = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
super(*args) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{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 | |
]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% -*- 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. |
NewerOlder