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
memoize = require 'memoizee' | |
endpoint = (done) -> | |
console.log "remote call" | |
setTimeout () -> | |
console.log "volam done" | |
done "vysledek" | |
, 1000 | |
endpoint (x) -> |
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
22 start { uri: 'http://false.cz' } | |
33 start { uri: 'http://false.cz/notfound' } | |
22 end 200 { date: 'Wed, 07 May 2014 09:09:40 GMT', | |
server: 'Apache/2.4.7 (Debian) SVN/1.8.5 mod_fcgid/2.3.9 mod_jk/1.2.37 PHP/5.5.8-2 OpenSSL/1.0.1g mod_perl/2.0.8 Perl/v5.18.2', | |
'x-powered-by': 'PHP/5.5.8-2', | |
vary: 'Accept-Encoding', | |
'content-length': '869', | |
'keep-alive': 'timeout=5, max=100', | |
connection: 'Keep-Alive', | |
'content-type': 'text/html' } |
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
r = (require 'easy-amqp') 'amqp://guest:guest@localhost' | |
r.queue('fro', durable: yes, autoDelete: no).bind('#').subscribe (m) -> | |
console.log m | |
r.on 'error', (err) -> | |
console.log 'amqp', err | |
# je to trosku hack, ale funguje to | |
r.conn.on 'end', () -> | |
r.conn.reconnect() |
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
wget http://mirror.hosting90.cz/apache/hbase/hbase-0.94.17/hbase-0.94.17.tar.gz | |
tar -xvzf hbase-0.94.17.tar.gz | |
HBASE_MANAGES_ZK=true ./hbase-0.94.17/bin/start-hbase.sh | |
... | |
./hbase-0.94.17/bin/stop-hbase.sh |
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 _jenkins() { | |
local cur tasks | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
tasks="$(/Users/bender/bin/jenkins --jobs)" | |
COMPREPLY=( $(compgen -W "$tasks" $cur) ) | |
} | |
complete -o default -F _jenkins jenkins c |
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
{ | |
"logs": { | |
"dynamic": "strict", | |
"properties": { | |
"@timestamp": { | |
"type": "date", | |
"index": "analyzed", | |
"format": "dateOptionalTime" | |
}, | |
"@version": { |
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
fs = require 'fs' | |
crypto = require 'crypto' | |
publicKey = fs.readFileSync './pub.pem' | |
plaintext = fs.readFileSync './plaintext' | |
cipertext = fs.readFileSync './ja.sig' | |
verify = (publicKey, text, cipher) -> | |
for h in ['rsa-sha1', 'rsa-sha1-2', 'sha1'] | |
try |
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
<?php | |
class Logger { | |
private $fd; | |
public function __construct() { | |
$this->fd = @fopen('php://fd/3', 'w'); | |
} | |
public function log($o) { | |
if($this->fd) { | |
return fputs($this->fd, "3:" . $o ."\n"); |
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
<?php | |
class Logger { | |
private $fd; | |
public function __construct() { | |
$this->fd = @fopen('php://fd/3', 'w'); | |
} | |
public function log($o) { | |
if($this->fd) { | |
return fputs($this->fd, "3:" . $o ."\n"); |
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
tty = require 'tty' | |
loggerFd = () -> | |
fd = 3 | |
return {log: console.log.bind console} unless tty.isatty fd | |
log: (o) -> |