Skip to content

Instantly share code, notes, and snippets.

View raykao's full-sized avatar
🇨🇦
¯\_(ツ)_/¯

Raymond Kao raykao

🇨🇦
¯\_(ツ)_/¯
View GitHub Profile
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
@raykao
raykao / DevTO Appy Hour April 23rd 2014.md
Last active August 29, 2015 14:00
#DevTO Appy Hour April 23rd 2014
@raykao
raykao / accelerometer_tilt.ino
Created June 27, 2014 14:44
Intro To Wearable Computing Workshop
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;
@raykao
raykao / vsftpd.conf
Created August 7, 2014 13:33
Conf file for vsftpd setup. Resolves issues with servers behind a nat. chroots users to their homedirs
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
@raykao
raykao / safety_vest.ino
Created August 15, 2014 17:01
Code to make your own blinking turn light tilt sensor safety vest
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;
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
#
# 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.
#
@raykao
raykao / bootstrap_sass_bower_ember-cli.md
Created November 14, 2015 23:05
How to add boostrap-sass to your ember-cli project with bower

How to work with bootstrap-sass in Ember (ember-cli) using the bower package

Install package with bower

Run:

bower install --save bootstrap-sass
@raykao
raykao / Fetch.sublime-settings
Last active December 16, 2015 03:49
config: Nettuts+ Fetch
{
"files":
{
"jquery": "http://code.jquery.com/jquery.min.js",
"normalize": "https://raw.github.com/necolas/normalize.css/master/normalize.css"
},
"packages":
{
"html5_boilerplate": "https://github.com/h5bp/html5-boilerplate/zipball/master",
"wordpress": "http://wordpress.org/latest.zip",
@raykao
raykao / notes.sublimetext.packages.txt
Created April 12, 2013 16:22
Notes: Sublime Text Packages
Nettuts+ Fetch
Prefixr
Emmet
AdvancedNewFile
Sublime Linter
SideBarEnhancements
Gist
DocBlockr
LiveReload