Install
Homebrew packages
brew install zeromq leiningen zookeeper
MultiPart.prototype.copy = function(writer, callback) { | |
var mp = this; | |
var parts = this.parts; | |
if(this.part != '') { parts.push(this.part); } | |
parts.push(CRLF + "--" + this.boundary + "--"); | |
parts.reverse(); | |
var BLOCKSIZE = 32*1024; | |
var readFile = function(fd, total, writer) { | |
var buffer = new Buffer(BLOCKSIZE); | |
fs.read(fd, buffer, 0, BLOCKSIZE, null, function(err, bytesRead) { |
require 'lib/worker.php'; | |
function getTitle($url) { | |
$html = file_get_contents("http://$url"); | |
if($html == FALSE) { | |
throw new Exception("can't fetch url"); | |
} | |
preg_match('/<title>(.*)<\/title>/i', $html, $matches); | |
return html_entity_decode($matches[1]); | |
} |
require 'eventmachine' | |
class NFuture | |
include EM::Deferrable | |
def initialize(times, &block) | |
@times = times | |
self.callback(&block) | |
end | |
def one_more_time(*arg) |
require "em-http-request" | |
require "em-synchrony" | |
class Weather | |
include EventMachine::Deferrable | |
attr_reader :code, :date, :temp, :humidity, :wind_speed | |
def _feed code, raw | |
rough = raw.split('#') | |
@code = code |
brew install zeromq leiningen zookeeper
#encoding: utf-8 | |
require 'rubygems' | |
require 'tire' | |
# | |
# Playing with analyzers and its parameters. | |
# Witch fits best for the french language? | |
# | |
# $ rvm use 1.9.2 | |
# $ gem install tire |
#encoding: utf-8 | |
require 'rubygems' | |
require 'tire' | |
require 'json' | |
require 'active_support/core_ext/object/to_query' | |
require 'active_support/core_ext/object/to_param' | |
conf = { | |
settings: { | |
number_of_shards: 1, |
#encoding: utf-8 | |
require 'rubygems' | |
require 'tire' | |
require 'json' | |
require 'active_support/core_ext/object/to_query' | |
require 'active_support/core_ext/object/to_param' | |
Tire.configure { logger 'elasticsearch.log', :level => 'debug' } | |
Tire.index 'ponctu' do |
#encoding: utf-8 | |
require 'rubygems' | |
require 'tire' | |
#require 'json' | |
require 'active_support/core_ext/object/to_query' | |
require 'active_support/core_ext/object/to_param' | |
Tire.configure { logger 'elasticsearch.log', :level => 'debug' } | |
tire = Tire.index 'path' do | |
delete |
Install the application
brew install kyotocabinet
Fetch the source : http://fallabs.com/kyotocabinet/pythonlegacypkg/
Compile
env ARCHFLAGS="-arch x86_64" python setup.py build