Skip to content

Instantly share code, notes, and snippets.

View pctj101's full-sized avatar

pctj101

  • Earth
View GitHub Profile
# An example of using ngram analysis in ElasticSearch with the Tire rubygem
# ==========================================================================
# The original, raw example: https://gist.github.com/988923
require 'rubygems'
require 'tire'
require 'yajl/json_gem'
class URL
def initialize(attributes={})
RailsRoot = File.expand_path "#{File.dirname __FILE__}/.."
PidsDir = "#{RailsRoot}/tmp/pids"
ListenAddress = "127.0.0.1"
ListenPort = 50000
UnixListen = "tmp/unicorn.sock"
Backlog = 2048
Workers = 10
Timeout = 30
@pctj101
pctj101 / embedded.go
Last active August 29, 2015 14:26 — forked from joshrotenberg/embedded.go
embedded nsqd
package main
// This is a basic example of running an nsqd instance embedded. It creates
// and runs an nsqd with all of the default options, and then produces
// and consumes a single message. You are probably better off running a
// standalone instance, but embedding it can simpllify deployment.
// See https://github.com/bitly/nsq/blob/master/nsqd/options.go and
// https://github.com/bitly/nsq/blob/master/apps/nsqd/nsqd.go for
// more details on how to configure an embedded nsqd instance.