- Some utilities:
sudo apt-get install vim tmux git
- Copy/paste from the command line:
sudo apt-get install xclip
# Scenario för att välja produkt | |
# Resurser som behövs är: | |
# @card_products | |
# Scenario för produkten 'Period buss' | |
# Resurser som behövs är: | |
# @product |
namespace :attachments do | |
task :migrate_to_s3 => :environment do | |
require 'aws/s3' | |
# Load credentials | |
s3_options = YAML.load_file(File.join(Rails.root, 'config/s3.yml')).symbolize_keys | |
bucket = s3_options[:bucket_name] | |
# Establish S3 connection |
# requests/edit_post_spec.rb | |
require 'spec_helper' | |
feature 'editing a post', js: true do | |
let(:post) { create :post } | |
let(:user) { post.creator } | |
before { sign_in user } |
# Usage: rake name:task app_name | |
task PROD = "appname" # "task" here stubs to prevent rake errors with commandline | |
task STAGING = "appname-staging" | |
APP = ARGV[1] || PROD # default app | |
puts "=== APP #{APP} ===" | |
namespace :deploy do |
require 'json' | |
class Saltsider | |
RANKS = ['Script Kid', 'n00b', 'Programmer', 'Rock Star', 'l33t', | |
'Saltsider'] | |
P_ATTRIBUTES = [:name, :email, :phone] | |
S_ATTRIBUTES = [:html, :css, :javascript, :ruby, :ruby_on_rails] | |
def initialize(attributes = {}) |
# The latest version of this script is now available at | |
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
VERSION=1.9.3-p327 | |
brew update | |
brew install rbenv ruby-build rbenv-vars readline ctags | |
if [ -n "${ZSH_VERSION:-}" ]; then | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
else | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
This installs a patched ruby 1.9.3-p385 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
# Example usage: | |
require 'active_record/nonpersisted_attribute_methods' | |
class Node < ActiveRecord::Base | |
include ActiveRecord::NonPersistedAttributeMethods | |
define_nonpersisted_attribute_methods [:bar] | |
# Example of using with ancestry and getting :parent to show up in changes hash. | |
has_ancestry | |
define_nonpersisted_attribute_methods [:parent] |