This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* by Joder Illi, Snowball mailing list */ | |
function stemm(word) { | |
/* | |
Put u and y between vowels into upper case | |
*/ | |
word = word.replace(/([aeiouyäöü])u([aeiouyäöü])/g, '$1U$2'); | |
word = word.replace(/([aeiouyäöü])y([aeiouyäöü])/g, '$1Y$2'); | |
/* | |
and then do the following mappings, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "OR", | |
"terms": [ | |
{ | |
"type": "AND", | |
"terms": [ | |
"foo", | |
"bar" | |
] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var testArray = [ | |
{ foo: 'bar', | |
foo_2: 'bar2', | |
foo_3: 123, | |
subobj: { foo_foo: 'barbar' } }, | |
{ foo: 'bar', | |
foo_2: 'bar2', | |
foo_3: 123, | |
subobj: { foo_foo: 'barbar' } }, | |
{ foo: 'bar', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var redis = require('redis'); | |
var client = redis.createClient(9056, 'char.redistogo.com'); // arguments are interchanged | |
client.auth('1234567890abcdefghijklm', function (err) { | |
if (err) { throw err; } | |
// You are now connected to your redis. | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nave_latest () { | |
curl -s http://nodejs.org/dist/ \ | |
| egrep -o '[0-9]+\.[0-9]+\.[0-9]+' \ | |
| sort -u -k 1,1n -k 2,2n -k 3,3n -t . \ | |
| tail -n1 | |
} | |
nave_stable () { | |
curl -s http://nodejs.org/dist/ \ | |
| egrep -o '[0-9]+\.[0-9]*[02468]\.[0-9]+' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --insecure -# -sSL http://nodejs.org/dist/ | sed -n -E "s/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/gp" | sort -u -k 1,1n -k 2,2n -k 3,3n -t . | tail -n1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update-rc.d logstash-shipper defaults | |
update-rc.d logstash-reader defaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ElasticSearch Service | |
description "ElasticSearch" | |
start on (net-device-up | |
and local-filesystems | |
and runlevel [2345]) | |
stop on runlevel [016] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function geocode(address) { | |
if(address) { | |
var response = Maps.newGeocoder().setRegion('at').geocode(address); | |
var longLat = {}; | |
var l; | |
Logger.log("address: " + address); | |
if (response.status === "OK") { | |
Logger.log("response " + JSON.stringify(response)); | |
if((l = response.results[0].geometry.location)) { | |
longLat.lng = l.lng; |
OlderNewer