- run
sudo apt-get install squashfs-tools kexec-tools
- copy "update.sh" to
/usr/sbin/update-coreos
, and make it executable - copy "create-docker-store.sh" to
/usr/sbin/create-coreos-docker-store
, and make it executable - copy "cloud-config.yml" to
/etc/default/coreos
, modifying it to suit your preferences - run
sudo update-coreos -d
- reboot
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
# app / controllers / application_controller.rb | |
class ApplicationController < ActionController::Base | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
protect_from_forgery with: :exception | |
before_filter :configure_permitted_parameters, if: :devise_controller? | |
protected | |
def configure_permitted_parameters |
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
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render json: user.as_json(auth_token: user.authentication_token, email: user.email), status: :created | |
return | |
else |
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 ActiveRecordMarshalable | |
def marshal_dump | |
[attributes, self.association_cache, instance_variable_get(:@new_record)] | |
end | |
def marshal_load data | |
send :initialize, data[0] | |
instance_variable_set :@association_cache, data[1] | |
instance_variable_set :@new_record, data[2] | |
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
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', :github => 'rails/rails' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
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
# config/locales/en.yml | |
en: | |
exception: | |
show: | |
not_found: | |
title: "Not Found" | |
description: "The page you were looking for does not exists." | |
internal_server_error: | |
title: "Internal Server Error" |
The only way to get working Homebrew on OS X 10.10 for now (10.10 beta was just released a couple of hours ago) is by using an special fork by @jacknagel available at https://github.com/jacknagel/homebrew/tree/rb2.
To install this working version of Homebrew just execute:
ruby -e "$(curl -fsSL https://gist.githubusercontent.com/jpincheira/bd3698fee46735fac252/raw/2c6a2f81927871c1a64e2dfbbc5eef451c71a9ac/homebrew.rb)"
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
DB -> Local | |
ssh [email protected] | |
pg_dump --format=c -h localhost --username norden nordenhealth > latest.dump | |
scp [email protected]:/home/deployer/latest.dump ~/Desktop/ | |
source ~/.bashrc && rake db:drop && rake db:create && pg_restore --verbose --clean --no-acl --no-owner -h localhost -U sac -d nordenhealth_development ~/Desktop/latest.dump | |
rake db:migrate RAILS_ENV=test && rake db:seed RAILS_ENV=test | |
Local -> DB | |
source ~/.bashrc && pg_dump --format=c -h localhost --username sac nordenhealth_development > ~/Desktop/t_latest.dump | |
scp ~/Desktop/t_latest.dump [email protected]:/home/deployer/t_latest.dump |
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
Installing Spring | |
On master branch: | |
1. $ bundle install | |
2. $ brew install direnv | |
3. edit shell config (~/.bashrc / .zshrc / config.fish), add at the very end: | |
eval "$(direnv hook bash)" | |
eval "$(direnv hook $0)" # for zsh | |
eval (direnv hook fish) # for fish | |
4. $ cd ~/project |
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 Workflow ========== | |
1 # Add gem stack | |
group :development, :test do | |
# Test stack | |
gem "rspec-rails", '~> 3.2.0' | |
gem "spring-commands-rspec" #Spring for rspec ^ | |
gem "factory_girl_rails" | |
gem "guard-rspec" | |
gem 'rb-fsevent', '~> 0.9.1' | |
gem "faker" #šis ģenerē dummy/fake datus pēc pieprasījuma |