Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am avifoxi on github.
  • I am aviatchegg (https://keybase.io/aviatchegg) on keybase.
  • I have a public key whose fingerprint is 6D3F 7D6C AE04 6ABE 052A 6711 5AA9 2140 4BAC 9F53

To claim this, I am signing this object:

@avifoxi
avifoxi / Traceur-on-CodePen.markdown
Created November 14, 2014 02:13
A Pen by Avi Fox-Rosen.
@avifoxi
avifoxi / Traceur-on-CodePen.markdown
Created November 14, 2014 02:11
A Pen by Chris Coyier.
@avifoxi
avifoxi / gist:895e8fe1504597d6546e
Created September 2, 2014 20:02
AR one page associations workout
require 'active_record'
require 'minitest/autorun'
require 'minitest/spec'
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
ActiveRecord::Migration.create_table :users do |t|
t.string :name
@avifoxi
avifoxi / MVC for WebAudio Sample Loading + Playback
Last active August 29, 2015 14:05
Attempting to put the Web Audio API into a scaleable JS MVC structure - using Boris Smus' intro to Web Audio article + book, and Alex Netkachov's JS MVC article
/// EVENT LINKING UTILITY CLASS FOR IMPLEMENTING OBSERVER PATTERN super coooool... thanks to http://alexatnet.com/articles/model-view-controller-mvc-javascript
function Event(sender) {
this._sender = sender;
this._listeners = [];
}
Event.prototype = {
attach : function (listener) {
this._listeners.push(listener);
@avifoxi
avifoxi / gist:3489f1e95d93fd956d4b
Created August 14, 2014 20:25
intercepting form submission - then get the data
// shorthand for $(document).ready();
$(function(){
//Your code...
var f = $('form');
$(f).submit( function(event){
event.preventDefault();
var children = event.currentTarget.childNodes;
var shitwecareabout = []
## within Deck MODEL
belongs_to :author, class_name :user
# in the DECK migration - add column
t.references :author
# in USER MODEL
has_many :played_decks, through: :rounds, source: "Deck"