Skip to content

Instantly share code, notes, and snippets.

require 'spec_helper'
share_as :SetCallbacks do
before(:each) do
@valid_attributes = {
:name => 'Forms'
}
@tag = Tag.new(@valid_attributes)
end
ruby -S bundle exec rspec "./spec/controllers/signup/investor_profile_controller_spec.rb" "./spec/controllers/signup/complete_profile_controller_spec.rb" "./spec/controllers/signup/advisor_profile_controller_spec.rb" "./spec/controllers/signup/companies_controller_spec.rb" "./spec/controllers/signup/industry_focus_controller_spec.rb" "./spec/controllers/signup/account_controller_spec.rb" "./spec/controllers/signup/educations_controller_spec.rb" "./spec/controllers/admin/access_controller_spec.rb" "./spec/controllers/invitation_requests_controller_spec.rb" "./spec/controllers/home_controller_spec.rb" "./spec/controllers/signup_controller_spec.rb" "./spec/helpers/signup/educations_helper_spec.rb" "./spec/helpers/signup/companies_helper_spec.rb" "./spec/helpers/signup/complete_profile_helper_spec.rb" "./spec/helpers/signup/industry_focus_helper_spec.rb" "./spec/helpers/signup/advisor_profile_helper_spec.rb" "./spec/helpers/signup/investor_profile_helper_spec.rb" "./spec/helpers/signup/account_helper_spec.rb" "./

How to set up your VPS with Chef Solo

1. What is it?

There are many different provisioning tools out there, the most popular of which are Chef and Puppet. Chef uses Ruby, Puppet uses a DSL (Domain Specific Language), there are others that use simple bash too, but today we're going to focus on Chef Solo.

2. Dependencies

To get Chef working properly on your local machine you need a few things.

Make sure you use Ruby 1.9.x and not Ruby 2.x as you will get errors with the json 1.6.1 gem on 2.x. Use rbenv or RVM to manage several different Rubies on the one machine.

# db/migrate/20131118172653_create_transactional_items_view.rb
class CreateTransactionalItemsView < ActiveRecord::Migration
def up
select_sql = File.open("#{Rails.root}/db/migrate/20131118172653_create_transactional_items_view.sql", 'r') { |f| f.read }
# for materialized view:
view_sql = "CREATE MATERIALIZED VIEW transactional_items AS (#{select_sql})"
# for normal view:
view_sql = "CREATE VIEW transactional_items AS (#{select_sql})"
@zdenal
zdenal / app.js
Created August 20, 2014 14:20 — forked from jgoux/app.js
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
{
"predef": {
...
"Bugsnag": true,
...
},
...
}
@zdenal
zdenal / Gemfile
Last active September 19, 2015 18:57 — forked from syon/Gemfile
SVG-to-PNG Converter using Ruby-GNOME2/RSVG on Sinatra
source "https://rubygems.org"
gem "sinatra"
gem "haml"
gem "rsvg2"
macro_rules! with_key {
($($t:ty),+) => ($(
impl WithKey for $t {
fn key(&self) -> &str {
&self.key
}
}
)+);
}
@zdenal
zdenal / .vimrc
Created November 11, 2016 20:54 — forked from millermedeiros/.vimrc
My VIM settings (.vimrc)
" =============================================================================
" Miller Medeiros .vimrc file
" -----------------------------------------------------------------------------
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory.
" =============================================================================
" -----------------------------------------------------------------------------
" BEHAVIOR
" -----------------------------------------------------------------------------
@zdenal
zdenal / Ruby Lambdas.md
Created January 7, 2017 22:58 — forked from Integralist/Ruby Lambdas.md
Ruby lambdas

Lambda: standard

# Creating a lambda
l = lambda { |name| "Hi #{name}!" }

# Executing the lambda
l.call("foo") # => Hi foo!