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
parse_git_branch () | |
{ | |
if git rev-parse --git-dir >/dev/null 2>&1 | |
then | |
gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p') | |
else | |
return 0 | |
fi | |
echo -e ":$(branch_color)$gitver${c_plain}" | |
} |
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
javascript: (function () { | |
var el = document.createElement('pre'), | |
b = document.getElementsByTagName('body')[0], | |
otherjQuery = false, | |
msg = '', | |
libs = [ | |
function loadjQuery() { | |
if (typeof jQuery != 'undefined') { | |
showMsg('This page already using jQuery v' + jQuery.fn.jquery); | |
} else { |
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 f() { | |
console.log('with local arguments'); | |
console.log(f.arguments === arguments); | |
console.log(f.arguments === f.arguments); | |
} | |
function f2() { | |
console.log('without local arguments'); | |
console.log(f2.arguments === f2.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
node-browserify [master] $ npm test | |
> browserify@2.35.4 test /Users/spenceralger/dev/node-browserify | |
> tap test/*.js | |
ok test/args.js ......................................... 2/2 | |
ok test/backbone.js ..................................... 4/4 | |
ok test/bin.js .......................................... 4/4 | |
ok test/bin_entry.js .................................... 4/4 | |
ok test/buffer.js ..................................... 14/14 |
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
bulk (POST/PUT) [POST] -> http://elasticsearch.org/guide/reference/api/bulk/ | |
count (POST/GET) [POST] -> http://elasticsearch.org/guide/reference/api/count/ | |
create (POST/PUT) [POST] -> http://elasticsearch.org/guide/reference/api/index_/ | |
explain (GET/POST) [POST] -> http://elasticsearch.org/guide/reference/api/explain/ | |
index (POST/PUT) [POST] -> http://elasticsearch.org/guide/reference/api/index_/ | |
indices.analyze (GET/POST) [POST] -> http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze/ | |
indices.clearCache (POST/GET) [POST] -> http://www.elasticsearch.org/guide/reference/api/admin-indices-clearcache/ | |
indices.create (PUT/POST) [POST] -> http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index/ | |
indices.flush (POST/GET) [POST] -> http://www.elasticsearch.org/guide/reference/api/admin-indices-flush/ | |
indices.optimize (POST/GET) [POST] -> http://www.elasti |
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(){ | |
var barColor = '#333'; | |
var defaultHeight = 150; | |
var defaultWidth = 400; | |
window.console.graph = function (points, height, width) { | |
var height = height || defaultHeight; | |
var width = width || Math.max(defaultWidth, points.length); | |
var barWidth = Math.floor(width / points.length); | |
var maxPoint = Math.max.apply(Math, points); |
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
gitFiles=$(git status --porcelain | grep "^[ADM\?][AMD] " | sed -e "s|^[ADM\?][AMD] ||") | |
if [[ -n "${gitFiles}" ]] ; then | |
for fname in $gitFiles ; do | |
git add --all -- "${fname}" | |
echo "Restaging ${fname}" | |
done | |
else | |
echo "No files changed" | |
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
var elasticsearch = require('./src/elasticsearch'); | |
var async = require('async'); | |
var _ = require('lodash-node'); | |
var client = new elasticsearch.Client({ | |
host: 'localhost:9200' | |
}); | |
async.eachSeries(_.range(100), function (value, done) { | |
async.eachSeries(_.range(500), function (value, done) { | |
client.create({ index: 'tests', type: 'test', body: {something: true, value: value} }, done); |
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 elasticsearch = require('elasticsearch'); | |
var baseNodesToHostCallback = require('elasticsearch/src/lib/nodes_to_host'); | |
var client = new elasticsearch.Client({ | |
/* host seed list */ | |
hosts: [ ... ], | |
// sniff every 5 minutes | |
sniffInterval: 1000 * 60 * 5, | |
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
{ | |
"aggConfig": { | |
"type": "terms", | |
"schema": "split", | |
"params": { | |
"field": "agent.raw", | |
"size": 2, | |
"order": "desc", | |
"row": true | |
} |
OlderNewer