Skip to content

Instantly share code, notes, and snippets.

View cararemixed's full-sized avatar
🏳️‍🌈

Cara Mitchell cararemixed

🏳️‍🌈
View GitHub Profile
@dherman
dherman / explanation.txt
Last active December 13, 2015 04:59
demonstrating that lexing JavaScript requires a pushdown automaton
Looking at the preceding token when the lexer points to a '/'
character is insufficient to determine which context it's in. In
fact, you need to look at an arbitrary number of preceding tokens
to figure it out. This example demonstrates a case where we can
pump up the number of preceding tokens to an arbitrary size
before you can disambiguate your syntactic context.
@egobrain
egobrain / cowboy_multipart_uploader.erl
Created May 30, 2012 06:47
Cowboy files uploader.
%%%-------------------------------------------------------------------
%%% @author egobrain <egobrain@linux-ympb>
%%% @copyright (C) 2012, egobrain
%%% @doc
%%% Function for uploading files and properties,which were sent as a
%%% multipart. Files are stored in tmp_folder with random name,
%%% generated by tmp_filename function.
%%% @end
%%% Created : 25 Mar 2012 by egobrain <egobrain@linux-ympb>
%%%-------------------------------------------------------------------
@rnewson
rnewson / gist:2387973
Created April 14, 2012 21:31
CouchDB Future Feature List - Round 2
A list of features that we want to see in CouchDB. Needs to be voted on so that it can become a priority queue.
User Facing Features
====================
1. Conflicts are the rule, not the exception
All previous versions of CouchDB hide conflicts by default (selecting
an arbitrary but consistent winning revision). Expert users can find
and resolve conflicts.
@marcel
marcel / gist:2100703
Created March 19, 2012 07:24
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@seancribbs
seancribbs / Gemfile
Created March 14, 2012 20:25
Static/file resources in Webmachine
source :rubygems
gem 'webmachine'
gem 'rack'

Fibur

Fibur is a library that allows concurrency during Ruby I/O operations without needing to make use of callback systems. Traditionally in Ruby, to achieve concurrency during blocking I/O operations, programmers would make use of Fibers and callbacks. Fibur eliminates the need for wrapping your I/O calls with Fibers and a callback. It allows you to write your blocking I/O calls the way you normally would, and still have concurrent execution during those I/O calls.

Example

Say you have a method that fetches data from a network resource:

@dustin
dustin / gist:951106
Created May 2, 2011 02:19
Couchbase Server Updates

Install the latest [Couchbase Server for OS X][cbserver].

Tell Terminal you want to be on the alpha track

defaults write com.couchbase.couchbase-server SUFeedURL http://appcast.couchbase.com/couchbase-alpha.xml

Check for updates.

See new stuff.

@fdmanana
fdmanana / gist:832610
Created February 17, 2011 20:27
The CouchDB replicator database

1. Introduction to the replicator database

A database where you PUT/POST documents to trigger replications and you DELETE to cancel ongoing replications. These documents have exactly the same content as the JSON objects we used to POST to /_replicate/ (fields "source", "target", "create_target", "continuous", "doc_ids", "filter", "query_params".

Replication documents can have a user defined "_id". Design documents (and _local documents) added to the replicator database are ignored.

The default name of this database is _replicator. The name can be changed in the .ini configuration, section [replicator], parameter db.

2. Basics

@ezmobius
ezmobius / gist:807334
Created February 2, 2011 06:37
Run this script on a mac osx box running 10.6 and you will get a luajit with batteries included and all the good libs
#!/bin/bash
# have to hand install this one sorry http://www.cmake.org/files/v2.8/cmake-2.8.3-Darwin-universal.tar.gz
if [ "$1" == "cleanup" ]; then
echo "Cleaning up old luajit install"
cd /usr/local/share
sudo rm -rf lua luajit-2.0.0-beta6