Skip to content

Instantly share code, notes, and snippets.

View cmilfont's full-sized avatar

Christiano Milfont cmilfont

View GitHub Profile
@cmilfont
cmilfont / tired.rb
Created May 30, 2011 14:41 — forked from karmi/tired.rb
Template for generating a no-frills Rails application with support for ElasticSearch full-text search via the Tire gem
# ===================================================================================================================
# Template for generating a no-frills Rails application with support for ElasticSearch full-text search via Tire
# ===================================================================================================================
#
# This file creates a basic, fully working Rails application with support for ElasticSearch full-text search
# via the Tire gem [http://github.com/karmi/tire].
#
# You DON'T NEED ELASTICSEARCH INSTALLED, it is installed and launched automatically by this script.
#
# Requirements
@cmilfont
cmilfont / server.js
Created May 19, 2011 15:09 — forked from jeffrafter/server.js
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {
@cmilfont
cmilfont / nodeconf_2011.md
Created May 7, 2011 03:01 — forked from guybrush/nodeconf_2011.md
a list of slides from nodeconf 2011
require.extensions[".json"] = function (module, filename) {
module.exports = JSON.parse(require("fs").readFileSync(filename, "utf8"))
}
/**
* by Dmitry Soshnikov <[email protected]>
*/
// infinite objects generator
let g = new function () {
while (true) {
yield;
}
};
//
// by Dmitry Soshnikov <[email protected]>
// MIT Style License
// see also: http://wiki.ecmascript.org/doku.php?id=strawman:iterators
//
// ---------------------------------------
// 1. Iteration via for-in loop
// ---------------------------------------
# Index
http://www.call4paperz.com/events.json
# Show do evento
http://www.call4paperz.com/events/1.json
# Show da proposta
http://www.call4paperz.com/events/1/proposals/1.json
# Evento com JSONP (preste atenção no p no formato)
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
#Steps
pkgin install couchdb
svccfg import /opt/local/share/smf/manifest/couchdb.xml
svcadm enable couchdb
#Test
curl http://127.0.0.1:5984/
{"couchdb":"Welcome","version":"1.0.1"}
var fs = require('fs'),
step = require('step'),
jsdom = require('jsdom'),
window = jsdom.createWindow(),
Script = process.binding('evals').Script;
window.document = {};
window.Ext = {data:{Record:{}}};
var fileNames = [