Skip to content

Instantly share code, notes, and snippets.

View alpicola's full-sized avatar

Ryo Tanaka alpicola

View GitHub Profile
@nbqx
nbqx / app.js
Created December 19, 2012 04:43
var fs = require('fs');
var vm = require('vm');
var _ = require('underscore');
var src = fs.readFileSync('test.js');
var code = (_.template("'use strict';(<%= src %>)(req,res)"))({src: src});
var app = require('express')();
app.get('/',function(req,res){
var cxt = {
@codeforkjeff
codeforkjeff / solarize.sh
Created November 27, 2011 06:43
shell script for setting gnome-terminal color palette to use Solarized theme
#!/bin/sh
#
# Shell script that configures gnome-terminal to use solarized theme
# colors. Written for Ubuntu 11.10, untested on anything else.
#
# Solarized theme: http://ethanschoonover.com/solarized
#
# Adapted from these sources:
# https://gist.github.com/1280177
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/
@maoe
maoe / WorkerWrapper.lhs
Created September 7, 2011 04:50
最小不動点を使ったworker/wrapper変換の様子
> {-# LANGUAGE MagicHash #-}
> module WorkerWrapper where
> import Prelude hiding (replicate, abs)
> import GHC.Prim (Int#)
> import GHC.Exts (Int(I#), (==#), (-#), (*#))
> import Data.Function (fix)
> fac :: Int -> Int
> fac 0 = 1
> fac n = n * fac (n - 1)
#!/usr/bin/env ruby
require 'rubygems'
require 'pit'
require 'scissor/echonest'
Scissor.echonest_api_key = Pit.get('echonest.com', :require => {
'api_key' => 'your Echo Nest API key'
})['api_key']
var util = require('util');
var events = require('events');
var request = require('request'); //https://github.com/mikeal/request
var Wordnet = function(words){
this.ret = [];
this.words = words;
this.url = "http://nymnym.heroku.com/word/";
events.EventEmitter.call(this);
};