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 | |
function accCommandCounts(array &$acc, array $stats) { | |
$re_cmd = '/cmdstat_([a-zA-Z]+)\|?([a-zA-Z]*)/'; | |
$re_num = '/^calls=(\d+).*/'; | |
foreach ($stats as $cmd => $info) { | |
if ( ! preg_match($re_cmd, $cmd, $matches)) | |
die("Malformed command name\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
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include <sys/time.h> | |
#include <locale.h> | |
#define MAX_DIGITS 3 |
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
// Compile with: cc -Wall -ggdb3 -o hiredis-binary-example hiredis-binary-example.c -lhiredis | |
#include <stdio.h> | |
#include <hiredis/hiredis.h> | |
#include <stddef.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct binaryData { | |
char *str; |
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
#include <stdlib.h> | |
#include <hiredis/hiredis.h> | |
int main() { | |
redisContext *c = redisConnect("127.0.0.1", 6379); | |
// Short circuit if we fail to allocate a redisContext or if it | |
// reports an error state. | |
if (c == NULL || c->err) { |
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
#include <stdio.h> | |
#include <termios.h> | |
#include <unistd.h> | |
/* If it is the carriage return thing, here is the exact same | |
* functionality, but also setting termio. | |
* NOTE: I have no idea what the performance implications of calling | |
* `tcgetaddr`/`tcsetaddr` for this little routine would be | |
* or whether it is acceptable in your situation. | |
*/ |
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
// Compile with: cc -Wall -otermio termio.c | |
#include <stdio.h> | |
#include <termios.h> | |
#include <unistd.h> | |
int main(void) { | |
static struct termios oldt, newt; | |
/* Get current termio settings */ |
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
FROM rockylinux:8 as build0 | |
RUN yum -y update && yum -y install gcc make autoconf gcc-c++ git wget libzstd-devel libxml2-devel \ | |
sqlite-devel | |
FROM build0 as build1 | |
# Download build and install PHP 8.0 | |
RUN mkdir -p /root/dev && cd /root/dev/ && \ | |
cd /root/dev/ && wget -q "https://www.php.net/distributions/php-8.0.14.tar.gz" && \ |
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
static int gen_varkey_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, | |
char *kw, int kw_len, int min_argc, int has_timeout, | |
char **cmd, int *cmd_len, short *slot) | |
{ | |
zval *z_args, *z_ele, *ztimeout = NULL; | |
HashTable *ht_arr; | |
char *key; | |
int key_free, i, tail; | |
size_t key_len; | |
int single_array = 0, argc = ZEND_NUM_ARGS(); |
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
#include "hiredis.h" | |
#include <assert.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <linux/if.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <stdlib.h> | |
char device[IFNAMSIZ]; |
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
637b1c4 1258108773 2009-11-13 TYPE | |
637b1c4 1258108773 2009-11-13 RPUSH | |
637b1c4 1258108773 2009-11-13 SADD | |
637b1c4 1258108773 2009-11-13 LPUSH | |
637b1c4 1258108773 2009-11-13 LPOP | |
637b1c4 1258108773 2009-11-13 EXISTS | |
637b1c4 1258108773 2009-11-13 PING | |
637b1c4 1258108773 2009-11-13 SREM | |
a2d436d 1258552009 2009-11-18 RPOP | |
9488119 1258553043 2009-11-18 SMOVE |
NewerOlder