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
# RSpec CanCan matcher. | |
# | |
# When testing your user must have an id otherwise a nil foreign key will | |
# match on new records. | |
# | |
# Examples | |
# | |
# describe User do | |
# subject { User.create! } | |
# |
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
# Adaptation of the VMware adapters fix script by Oisin Grehan: | |
# http://www.nivot.org/post/2008/09/05/VMWareVMNETAdaptersTriggeringPublicProfileForWindowsFirewall.aspx | |
# see http://msdn2.microsoft.com/en-us/library/bb201634.aspx | |
# | |
# *NdisDeviceType | |
# | |
# The type of the device. The default value is zero, which indicates a standard | |
# networking device that connects to a network. | |
# |
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
# Add the following lines to .git/hooks/prepare-commit-msg and | |
# ensure it is executable. | |
# Prefix the message with the branch's name e.g. "#STORY-23: " | |
# The reason the branch line is commented is to prevent accidental | |
# commits. | |
BRANCH=`git branch | grep '^*' | sed -e 's/^\* //'` | |
MESSAGE=`cat "$1"` | |
echo "#$BRANCH: $MESSAGE" > "$1" |
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
#!/bin/sh | |
COMMAND="magick" | |
for FILE in *.png | |
do | |
echo "Processing $FILE" | |
echo $COMMAND $FILE | |
done |
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
!/bin/bash | |
cd /tmp | |
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz | |
tar xzf rubygems-1.3.7.tgz | |
cd rubygems-1.3.7 | |
sudo ruby ./setup.rb |
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 run_all_tests | |
# see Rakefile for the definition of the test:all task | |
system( "rake -s test" ) | |
end | |
def run(cmd) | |
puts(cmd) | |
system(cmd) | |
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
namespace :deploy do | |
namespace :assets do | |
task :precompile, :roles => :web, :except => { :no_release => true } do | |
assets_path = File.join(release_path, "public/assets") | |
assets_empty = capture("ls -x #{assets_path}").length == 0 | |
has_current_release = capture("if [ -d #{current_path} ]; then echo -n \"yes\"; fi") == "yes" | |
compile_assets = false |
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 'spec_helper' | |
describe ActiveAdmin::ResourceCollection do | |
let(:application) { ActiveAdmin::Application.new } | |
let(:namespace) { ActiveAdmin::Namespace.new(application, :admin) } | |
context ".add" do | |
let(:resource) { ActiveAdmin::Resource.new(namespace, AdminUser) } | |
let(:resource_renamed) { ActiveAdmin::Resource.new(namespace, AdminUser, as: "SuperAdminUser") } |
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
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" | |
gem "rails", github: "rails/rails" |
OlderNewer