Skip to content

Instantly share code, notes, and snippets.

# config.ru
gem 'rack-rewrite', '~> 1.5.1'
require 'rack/rewrite'
use Rack::Rewrite do
rewrite %r{^(.*)}, '/index.html'
end
run Rack::File.new "#{Dir.getwd}/public"
source 'https://rubygems.org'
gem "rack"
gem "rack-rewrite"
source 'https://rubygems.org'
gem "rack"
gem "rack-rewrite"
module.exports = function(sequelize, DataTypes) {
var Model = sequelize.define('Model', {
dates : {
type : DataTypes.ARRAY(DataTypes.DATE) ,
allowNull : false ,
validate : {
isDate : true
}
}
}, {
@nrmitchi
nrmitchi / client.js
Last active December 30, 2015 01:49
Client-side Upload to S3
/*
Note that this is rather specific to what I was doing due to things like endpoints and message bodies. You will have to change this to fit your purposes
*/
function uploadObject () {
//This is so that I can access the object from within the XMLHTTPRequest event functions
var that = this;
this.setCallback = function (cb) {
@nrmitchi
nrmitchi / README.mkd
Created November 20, 2013 21:46 — forked from mjallday/README.mkd

Make a client

curl http://balanced-hangman.herokuapp.com

Hopefully you'll see something like

{
 "index": "/", 
 "me": "/me", 
@nrmitchi
nrmitchi / gist:5256118
Created March 27, 2013 17:09
Small proof of js passing by reference
var a = { 'a': 1, 'b':2 };
var b = a
console.log(a);
console.log(b);
//Note that they are the same
b.a = 3
console.log(a);
console.log(b);
@nrmitchi
nrmitchi / PandoraTitleScroller.js
Last active December 14, 2015 05:19
Scroll title/artist in tab title for Pandora
// Copy/paste into Console/Firebug
window.PandoraTitleScroller = {}
window.PandoraTitleScroller.index = 0;
window.PandoraTitleScroller.length = 20;
window.PandoraTitleScroller.title = $('.trackData').children().first().children().first().html() + ' by ' + $('.trackData').children().eq(1).children().eq(1).html();
//Kinda buggy but it works for what I wanted
window.setInterval(function () {