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
They both write the same value when the node script uses a Buffer. | |
~/Downloads/2010-05-07/compatibility_issue ⚡ redis-cli flushall | |
OK | |
~/Downloads/2010-05-07/compatibility_issue ⚡ !node | |
node write_file_to_redis.js 2> output.node | |
~/Downloads/2010-05-07/compatibility_issue ⚡ redis-cli get test_key | |
"\x1f\x8b\b\b\x80\xce\xe3K\x00\x03testfile.txt\x00\x0b\xc9\xc8,V\x00\xa2\xe2\xfc\xdcT\x85\x94\xc4\x92D\x85\x92\x8c\xc4\x12\x90Hz~f^\xbaBI\xbeBR\xaaBr~nAQjqqj\n\x17\x00\xc8\xcerT1\x00\x00\x00" |
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
~/projects/redis-node-client(master) ⚡ redis-cli set test:c a | |
OK | |
~/projects/redis-node-client(master) ⚡ redis-cli set 'test: d' b | |
OK | |
~/projects/redis-node-client(master) ⚡ redis-cli keys '*' | |
1. "test:c" | |
2. "test: d" |
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 sys = require('sys'), | |
net = require('net'), | |
server = net.createServer(function (c) { | |
var input = ''; | |
c.setEncoding('utf8'); | |
c.addListener("data", function (chunk) { | |
input += chunk; | |
var match; | |
while (match = input.match(/^(.+)\r\n/)) { | |
input = input.substr(match[0].length); |
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
/tmp ⚡ mkdir foo | |
/tmp ⚡ cd foo | |
/tmp/foo ⚡ git init | |
Initialized empty Git repository in /private/tmp/foo/.git/ | |
/tmp/foo ⚡ echo "x" > x | |
/tmp/foo ⚡ git add x |
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
cd /tmp | |
git clone git://github.com/ry/node.git | |
cd node | |
git checkout 3768aaae | |
./configure --prefix=/tmp/node |
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
AnyEvent::MessagePack -> node-msgpack | |
seems to work as expected... yay. | |
recv 4 bytes | |
147 | |
1 | |
2 | |
3 | |
unpacked 1,2,3 |
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
node> fs.readFileSync('/proc/self/status') | |
'Name:\tnode\nState:\tR (running)\nSleepAVG:\t98%\nTgid:\t12179\nPid:\t12179\nPPid:\t12178\nTracerPid:\t0\nUid:\t1000\t1000\t1000\t1000\nGid:\t1000\t1000\t1000\t1000\nFDSize:\t32\nGroups:\t1000 \nVmPeak:\t 43628 kB\nVmSize:\t 43624 kB\nVmLck:\t 0 kB\nVmHWM:\t 7280 kB\nVmRSS:\t 6772 kB\nVmData:\t 35540 kB\nVmStk:\t 84 kB\nVmExe:\t 3628 kB\nVmLib:\t 4172 kB\nVmPTE:\t 44 kB\nThreads:\t1\nSigQ:\t1/2944\nSigPnd:\t0000000000000000\nShdPnd:\t0000000000000000\nSigBlk:\t0000000000000000\nSigIgn:\t0000000000001000\nSigCgt:\t0000000180010000\nCapInh:\t0000000000000000\nCapPrm:\t0000000000000000\nCapEff:\t0000000000000000\n' |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/un.h> | |
#define SOCK_PATH "/tmp/test.sock" | |
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
function testHGETALL() { | |
client.hset("foo", "bar", "baz", expectNumber(1, "testHGETALL")); | |
client.hset("foo", "quux", "doo", expectNumber(1, "testHGETALL")); | |
client.hgetall("foo", function (err, all) { | |
if (err) assert.fail(err, "testHGETALL"); | |
redisclient.convertMultiBulkBuffersToUTF8Strings(all); | |
checkDeepEqual(all, { bar:"baz", quux:"doo" }, "testHGETALL"); | |
}); | |
} |
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
from bottle import get, run, debug, send_file, request, hook, abort, post | |
import os, redis, hashlib | |
r = redis.Redis() | |
OPEN_URLS = ( '/', '/users/new' ) | |
@hook('before_request') | |
def require_authenticated_requests(): | |
""" |