Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block captDaylight

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gaearon /
Last active Dec 30, 2019
A Gentle Introduction to Prepack, Part 1


When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
developit / *
Last active May 31, 2018
265b lib for building pure functional state machine components.
View *


A tiny (265 byte) utility to create state machine components using two pure functions.

🔥 JSFiddle Demo


The API is a single function that accepts 2 pure functions as arguments:

View slimdown.js
'use strict';
* Javascript version of
* Slimdown - A very basic regex-based Markdown parser. Supports the
* following elements (and can be extended via Slimdown::add_rule()):
* - Headers
* - Links
staltz /
Last active Jan 18, 2020
The introduction to Reactive Programming you've been missing
dericcrago / gist:1886177
Created Feb 22, 2012
add trailing slash to Backbone.Model urls
View gist:1886177
// example
User = Backbone.Model.extend({
url: function() {
var origUrl =;
return origUrl + (origUrl.charAt(origUrl.length - 1) == '/' ? '' : '/');

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010


  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].

View trivial_file_upload_service.rb
require 'rubygems'
require 'sinatra'
require 'fileutils'
# upload with:
# curl -v -F "data=@/path/to/filename" http://localhost:4567/user/filename
# or just go to http://localhost:4567/user/filename with a browser
get '/:name/:filename' do
gavinheavyside / trivial_file_upload_service.rb
Created Nov 3, 2009
Trivial file upload service using Sinatra
View trivial_file_upload_service.rb
require 'rubygems'
require 'sinatra'
require 'fileutils'
# upload with:
# curl -v -F "data=@/path/to/filename" http://localhost:4567/user/filename
post '/:name/:filename' do
userdir = File.join("files", params[:name])
You can’t perform that action at this time.