$ rails g model User
belongs_to
has_one
// | |
// Signal+Extensions.swift | |
// Khan Academy | |
// | |
// Created by Nacho Soto on 10/1/15. | |
// Copyright © 2015 Khan Academy. All rights reserved. | |
// | |
import ReactiveCocoa |
protocol Monad { | |
typealias F | |
typealias U | |
class func bind<M : Monad where M.U == U>(Self, F -> M) -> M | |
class func `return`(F) -> Self | |
} | |
extension Array : Monad { | |
typealias F = T |
namespace :figaro do | |
desc "SCP transfer figaro configuration to the shared folder" | |
task :setup do | |
transfer :up, "config/application.yml", "#{shared_path}/application.yml", :via => :scp | |
end | |
desc "Symlink application.yml to the release path" | |
task :finalize do | |
run "ln -sf #{shared_path}/application.yml #{release_path}/config/application.yml" | |
end |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: delayed_job | |
# Required-Start: $all | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
### END INIT INFO |
# The YUM package is too old for use with ruby-sqlite3, use the autoconf package from www.sqlite.org | |
cd /opt | |
wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz | |
tar xvzf sqlite-autoconf-3070701.tar.gz | |
ln -s /opt/sqlite-autoconf-3070701 /opt/sqlite3 | |
cd /opt/sqlite3 | |
./configure --prefix=/opt/sqlite3 | |
make | |
make install | |
# Shared library will be installed in /usr/local/lib. |
require 'zmq' | |
require 'json' | |
handler_ctx = ZMQ::Context.new(1) | |
# receive and response for mongrel2 handlers | |
# queue address corresponds to what's in the configuration | |
recv_queue = handler_ctx.socket(ZMQ::PULL) | |
recv_queue.connect("tcp://127.0.0.1:9999") |
$.ajaxSetup({ | |
headers: { | |
"X-CSRF-Token": $("meta[name='csrf-token']").attr('content') | |
} | |
}); |