Run:
bower install --save bootstrap-sass
#!/bin/bash | |
# load enviroment variables and other necessary itemes (e.g. node via nvm) | |
source ~/.bash_profile | |
# Set Directory locations: | |
# | |
# WORKING_DIR -> The directory that actually houses the working code | |
WORKING_DIR="/home/<username>/editor.womenandtech.com" | |
# GIT_DIR -> The git repo DIR |
# config/initializers/mongoid.rb | |
# convert object key "_id" to "id" and remove "_id" from displayed attributes on mongoid documents when represented as JSON | |
module Mongoid | |
module Document | |
def as_json(options={}) | |
attrs = super(options) | |
id = {id: attrs["_id"].to_s} | |
attrs.delete("_id") | |
id.merge(attrs) |
# | |
# Slightly tighter CORS config for nginx | |
# | |
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
# | |
# Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
# don't seem to play nicely with this. | |
# |
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
int groundpin = 18; // analog input pin 4 | |
int powerpin = 19; // analog input pin 5 | |
int xpin = A3; // x-axis of the accelerometer | |
int ypin = A2; // y-axis | |
int zpin = A1; // z-axis (only on 3-axis models) | |
long xy_max = 500; | |
long xy_min = 540; | |
int leftPin = 11; | |
int rightPin = 8; |
listen=YES | |
anonymous_enable=NO | |
local_enable=YES | |
write_enable=YES | |
local_umask=022 | |
dirmessage_enable=YES | |
use_localtime=YES | |
xferlog_enable=YES | |
connect_from_port_20=YES | |
chroot_local_user=YES |
int groundpin = 18; // analog input pin 4 | |
int powerpin = 19; // analog input pin 5 | |
int xpin = A3; // x-axis of the accelerometer | |
int ypin = A2; // y-axis | |
int zpin = A1; // z-axis (only on 3-axis models) | |
long xy_max = 470; | |
long xy_min = 550; | |
int forwardPin = 9; | |
int backPin = 10; |
Presentation notes for #DevTO - Appy Hour #1 April 23rd 2014.
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=>201 | |
return | |
else |