- Some utilities:
sudo apt-get install vim tmux git
- Copy/paste from the command line:
sudo apt-get install xclip
# 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 |
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 = {}) |
# 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 |
# 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 } |
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 |
# 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 |
class AddCountTriggers < ActiveRecord::Migration | |
def up | |
execute %q{ | |
CREATE OR REPLACE FUNCTION update_task_counters (taskid integer) | |
RETURNS void AS $$ | |
BEGIN | |
update tasks set | |
users_count = coalesce((select count(9) from taskships where task_id = taskid), 0) | |
where id = taskid; | |
END; |
if (typeof console === "undefined" || typeof console.log === "undefined") { | |
console = { | |
log: function() { | |
} | |
}; | |
} |
gem 'tire', '~> 0.4.1'
Bonsai provisions one ElasticSearch index per application. Tire, however, assumes that each model is using its own index.
Currently the best way to work around this is to set the Tire.configuration.url
and the model's index_name
manually.