Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <assert.h>
#include "hiredis.h"
#include "async.h"
#include "adapters/libev.h"
void message(redisAsyncContext *c, redisReply *reply, void *privdata) {
#
# Fatal error in /home/pieter/tools/node-src-master/deps/v8/src/handles-inl.h, line 49
# CHECK(reinterpret_cast<Address>(*location_) != kHandleZapValue) failed
#
Program received signal SIGABRT, Aborted.
0x00007ffff64d1a75 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
in ../nptl/sysdeps/unix/sysv/linux/raise.c
var hiredis = require("./hiredis");
var reader = new hiredis.Reader();
reader.feed(
"+OK\r\n" +
"$25\r\nA value with Unicode: ☕\r\n" +
"+OK\r\n" +
"*4\r\n$5\r\nprop1\r\n$4\r\nval1\r\n$5\r\nprop2\r\n$4\r\nval2\r\n"
);
require "redis"
$redis = Redis.new
loop do
$redis.lpush("key", "xxxxxxxx")
$redis.ltrim("key", 0, 1499)
end
require "socket"
PORT = 12345
pid = fork do
trap("TERM") { exit }
server = TCPServer.new("127.0.0.1", PORT)
loop do
Process: coreservicesd [22]
Path: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Support/coreservicesd
Identifier: coreservicesd
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: launchd [1]
Date/Time: 2011-02-18 14:16:37.628 +0100
OS Version: Mac OS X 10.6.6 (10J567)
Report Version: 6
/* Convert a string into a long long. Returns 1 if the string could be parsed
* into a (non-overflowing) long long, 0 otherwise. */
int string2ll(char *s, size_t slen, long long *value) {
char *p = s;
size_t plen = 0;
int negative = 0;
unsigned long long v;
if (slen == 0)
return 0;
string2ll-cur: 9223372036854775807: 594204us
string2ll-new: 9223372036854775807: 125894us
string2ll-cur: 1: 67819us
string2ll-new: 1: 14089us
string2ll-cur: x: 33182us
string2ll-new: x: 8979us
string2ll-cur: 12345x: 42122us
string2ll-new: 12345x: 37157us
string2ll-cur: 922337203685477580x: 84942us
string2ll-new: 922337203685477580x: 115623us
require "rubygems"
require "redis"
$redis = Redis.new
case ARGV.shift
when "work"
# Blocking pop on queue
args = ["queue", 0]
loop do
queue, payload = $redis.blpop(*args)
$ redis-cli --help
redis-cli 2.2.2 (git:de5d4be9)
Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
-h <hostname> Server hostname (default: 127.0.0.1)
-p <port> Server port (default: 6379)
-s <socket> Server socket (overrides hostname and port)
-a <password> Password to use when connecting to the server
-r <repeat> Execute specified command N times
-n <db> Database number