This file contains hidden or 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 o = { data: { success: true } } | |
maybe('o') | |
.with('data') | |
.with('success') | |
.if(function(x){ | |
return x === true; | |
}) | |
.do(function(x){ | |
if(x === null){return "if failed"} else{ return "if succeded"} |
This file contains hidden or 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
config.json | |
reading-image.png |
This file contains hidden or 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
"use strict"; | |
var slug = require('slug'); | |
var hashFunctions = { | |
/** | |
* Return string hash, based on first two symbols of string | |
* @param {string} str Str to calculate the hash | |
*/ | |
"two_symbol_hash": function (str) { |
This file contains hidden or 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
for word in "$@" | |
do | |
args=true | |
newQueues=$(rabbitmqctl list_queues name | grep "$word") | |
queues="$queues | |
$newQueues" | |
done | |
if [ $# -eq 0 ]; then | |
queues=$(rabbitmqctl list_queues name | grep -v "\.\.\.") | |
fi |
This file contains hidden or 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
# Count greped lines | |
grep pattern | wc -l | |
# Count greped lines, and display them | |
grep pattern | tee /dev/tty | wc -l |
This file contains hidden or 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 pg = require('pg'); | |
var Service = function (connectionConfig) { | |
this.connectionConfig = connectionConfig; | |
this._client = null; | |
this._releaseClient = null; | |
this.isConnected = false; | |
}; | |
Service.prototype._connection = function (callback) { |
This file contains hidden or 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 casper = require('casper').create({ | |
pageSettings: { | |
// javascriptEnabled: false | |
} | |
}); | |
var system = require('system'); | |
var options = casper.cli.options; |
This file contains hidden or 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
cat <(ssh server1 sudo tail -f /var/log/log.log) <(ssh server2 sudo tail -f /var/log/log.log) | grep /api/1/test >> hits |
This file contains hidden or 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
cat <(ssh server1 sudo tail -f /var/log/test.log) <(ssh server2 sudo tail -f /var/log/test.log) | grep /api/1/test >> hits & watch wc -l hits |
This file contains hidden or 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
# Get list of streams | |
aws kinesis list-streams --region {region: us-east-1} | |
# Get list of shards for a stream | |
aws kinesis describe-stream --region {region: us-east-1} --stream-name {stream_name} | |
# Split | |
aws kinesis split-shard --region {region: us-east-1} --stream-name {stream_name} --shard-to-split {shard_id_to_split} --new-starting-hash-key {new_starting_hash_key:(shard ending hashkey / 2)} | |
# Check that it worked | |
aws kinesis describe-stream --region {region: us-east-1} --stream-name {stream_name} |
OlderNewer