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.prototype.bind = function(obj) { | |
if (Function.prototype.bind) { return Function.prototype.bind.apply(this, arguments) } | |
var that = this, | |
slice = function(a, b) { return a.length - (b || 0) ? Array.prototype.slice.call(a, b || 0) : [] }, | |
concat = function(a, b) { return a.length ? b.length ? a.concat(b) : a : b; }, | |
args = slice(arguments, 1); | |
return function() { | |
that.apply(obj, concat(args, slice(arguments))); |
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
#!/bin/bash | |
# File lives in .git/hooks/pre-push | |
# If the following text is found anywhere in the source for HEAD, we will prevent pushing | |
dont_push_flag="DONT PUSH ME" | |
flag_found=`git grep --color "$dont_push_flag" HEAD` | |
if [ -n "$flag_found" ] | |
then |
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
angular.module('contra.eventEmitter', []) | |
.factory('eventEmitter', function () { | |
'use strict'; | |
return { | |
emitter: function (thing) { | |
var evt = {}, | |
tick = function tick (fn) { setTimeout(fn, 0); }, | |
debounce = function (fn, args) { if (!fn) { return; } tick(function run () { fn.apply(null, args || []); }); } | |
if (thing === undefined) { thing = {}; } |
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
angular.module('contra.eventEmitter', []) | |
.factory('eventEmitter', function () { | |
'use strict'; | |
return { | |
emitter: function (thing) { | |
var evt = {}, | |
tick = function tick (fn) { setTimeout(fn, 0); }, | |
debounce = function (fn, args) { if (!fn) { return; } tick(function run () { fn.apply(null, args || []); }); } | |
if (thing === undefined) { thing = {}; } |
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
// close the index with `POST` (using `PUT` will throw error) | |
curl -XPOST localhost:9200/users/_close | |
// Update with the analysis with a `PUT` (using `POST` will throw error) | |
curl -XPUT localhost:9200/users/_settings -d '{ | |
"analyzer": { | |
"ngram_languages": { | |
"tokenizer": "ngram_languages_tokenizer" | |
} | |
}, |
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
# Usage: Create a new combiner instance for each new object that needs assembling | |
# And call #add to add each new chunk | |
# | |
# combiner = combiners[identifier] or new Combiner( | |
# numberOfChunks: numberOfChunks | |
# filename: filename | |
# identifier: identifier | |
# directory: @temporaryFolder | |
# callback: -> | |
# # destroy reference as it's no longer needed |
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
#!/bin/bash | |
NAME=elasticsearch | |
DIR=/opt/${NAME} | |
PID=/var/run/${NAME}.pid | |
if [ ! -f $PID ]; then | |
echo $$ > $PID | |
fi |
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 Configuration Example ##################### | |
# This file contains an overview of various configuration settings, | |
# targeted at operations staff. Application developers should | |
# consult the guide at <http://elasticsearch.org/guide>. | |
# | |
# The installation procedure is covered at | |
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>. | |
# | |
# Elasticsearch comes with reasonable defaults for most settings, |
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
#!/bin/sh -e | |
# | |
# rc.local | |
# | |
# This script is executed at the end of each multiuser runlevel. | |
# Make sure that the script will "exit 0" on success or any other | |
# value on error. | |
# | |
# In order to enable or disable this script just change the execution | |
# bits. |
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
# Path to your oh-my-zsh installation. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# Example aliases |
OlderNewer