This file contains hidden or 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 assets? | |
begin | |
Rails.application.config.assets.enabled || false | |
rescue NoMethodError | |
false | |
end | |
end |
This file contains hidden or 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
namespace :i18n do | |
desc "Copy translations from simple backend (YAML) to Active Record" | |
task :copy2ar => :environment do | |
unless I18n.backend.instance_of?(I18n::Backend::Simple) | |
I18n.backend = I18n::Backend::Simple.new | |
I18n.backend.load_translations | |
end | |
Translation.delete_all | |
I18n.available_locales.each do |loc| |
This file contains hidden or 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 Enumerable | |
def each_with_previous | |
self.inject(nil) { |pre, cur| yield pre, cur; cur } | |
self | |
end | |
end |
This file contains hidden or 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
RSpec::Matchers.define :eq_in_one_line do |target| | |
match do |source| | |
source.gsub(/\n/, '').should eq target.gsub(/\n/, '') | |
end | |
end |
This file contains hidden or 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 "softlayer_api" | |
id = 2841947 | |
sl = SoftLayer::Service.new('SoftLayer_Virtual_Guest', | |
:api_key => "<my_api_key>", | |
:username => "<my_username>" | |
) | |
sl.object_with_id(id).deleteObject |
This file contains hidden or 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
#!/bin/bash | |
echo "o | |
Y | |
n | |
1 | |
2048 | |
8388641 | |
FD00 | |
n |
This file contains hidden or 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
Vagrant.configure("2") do |config| | |
config.vm.box = "precise64" | |
config.vm.network :forwarded_port, :guest => 8080, :host => 8080 | |
config.vm.provision "docker" do |d| | |
d.pull_images "jbfink/docker-wordpress" | |
d.run "jbfink/docker-wordpress", :args => "-d -p 8080:80" | |
end | |
end |
This file contains hidden or 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
# Template for a Zurb Foundation app. It uses Bower to manage frontend resources. | |
opts = options.dup | |
opts.delete("template") | |
# Check for valid template engine. | |
until ["erb", "haml", "slim"].include?(opts["renderer"]) | |
opts["renderer"] = ask( | |
"Foundation is not compatible with #{opts["renderer"]} template engine. Choose another one [erb|haml]", | |
"slim" | |
) |
This file contains hidden or 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 "json" | |
Vagrant.configure("2") do |config| | |
config.vm.define "djenkins" do |djenkins| | |
djenkins.vm.box = "raring64_chef11" | |
djenkins.vm.box_url = "http://goo.gl/Y4aRr" | |
# Configuration for vagrant-omnibus plugin | |
djenkins.omnibus.chef_version = :latest |
This file contains hidden or 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
REM Ensure that vagrant-berkshelf is not installed (it conflicts with vagrant-librarian-chef) | |
vagrant plugin uninstall vagrant-berkshelf | |
REM Install the plugin | |
vagrant plugin install vagrant-librarian-chef | |
REM Remove conflicting versions of the ffi gem from .vagrant.d | |
set GEM_HOME=%USERPROFILE%\.vagrant.d\gems | |
C:\HashiCorp\Vagrant\embedded\bin\gem uninstall ffi --ignore-dependencies --version ">1.5.0" |
OlderNewer