Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active July 25, 2024 13:33
The introduction to Reactive Programming you've been missing
@callumacrae
callumacrae / build-tools.md
Last active October 25, 2023 15:14
Build tools written in JavaScript
@avdi
avdi / message.rb
Created June 15, 2013 16:17
Something I've been thinking about for a while...
# An experiment in higher-order (?) messages in Ruby.
class Message
attr_reader :name
attr_reader :arguments
def initialize(name, *arguments)
@name = name
@arguments = arguments
end
@marcomd
marcomd / gist:3129118
Created July 17, 2012 12:18
Authenticate your API with devise, token by header
#Session controller provides a token
#/controllers/api/sessions_controller.rb
class Api::SessionsController < Devise::SessionsController
before_filter :authenticate_user!, :except => [:create]
before_filter :ensure_params_exist, :except => [:destroy]
respond_to :json
def create
resource = User.find_for_database_authentication(:email => params[:user_login][:email])
return invalid_login_attempt unless resource
@cowboy
cowboy / HEY-YOU.md
Last active July 1, 2024 08:37
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.