Skip to content

Instantly share code, notes, and snippets.

@oneman
oneman / fiddle.css
Last active August 29, 2015 14:23 — forked from zalun/fiddle.css
#logo { margin: 1em; }
#events {
font-family: sans-serif;
box-shadow: 4px 4px 10px 5px grey;
display: flex;
flex-direction: column;
}
#events > .event {
margin: 1em;
margin-top: 0.5em;
@oneman
oneman / out.diff
Last active August 29, 2015 14:03 — forked from dsheeler/out.diff
diff --git a/lib/ops/server.c b/lib/ops/server.c
index f9a3e2a..a67d6fb 100644
--- a/lib/ops/server.c
+++ b/lib/ops/server.c
@@ -208,19 +208,21 @@ static int add_route(kr_front_router *router, const char *str) {
}
static ssize_t say_something(kr_web_path *path, const char *something) {
+ kr_web_client *client;
kr_http_header hdr;
@oneman
oneman / out.diff
Created June 30, 2014 08:02 — forked from dsheeler/out.diff
diff --git a/daemon/krad_ops.c b/daemon/krad_ops.c
index 2d1068c..74815fd 100644
--- a/daemon/krad_ops.c
+++ b/daemon/krad_ops.c
@@ -37,7 +37,7 @@ typedef struct kr_media_ops_server kr_media_ops_server;
#define KR_COMMAND_SIZE 512
#define KR_OPS_NTASKS 64
-#define KR_TIMEOUT_SEC 1
+#define KR_TIMEOUT_SEC 100
#include <sys/uio.h>
static FILE *launch_pgrep() {
char cmd[512];
snprintf(cmd, 512, "pgrep kr");
cmd[511] = '\0';
return launch_command(cmd);
}
static FILE *launch_stressor() {
/*stress --cpu 4 --vm 4 */
static FILE *launch_pgrep() {
char cmd[512];
snprintf(cmd, 512, "pgrep kr");
cmd[511] = '\0';
return launch_command(cmd);
}
static FILE *launch_stressor() {
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/signalfd.h>
#include <sys/epoll.h>
#include <sys/timerfd.h>
@oneman
oneman / gist:9561870
Last active August 29, 2015 13:57 — forked from dsheeler/gist:9560509
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/signalfd.h>
#include <sys/epoll.h>
#include <sys/timerfd.h>
@oneman
oneman / gist:7396545
Last active December 27, 2015 22:09 — forked from dsheeler/gist:7395927
signal_type = [ CALL, ANSWER, HANGUP ]
user {
user_name;
}
connection {
string user[2];
}
#include <cairo.h>
#include "kr_client.h"
#include <ccv.h>
typedef struct kr_snapshot {
uint32_t width;
uint32_t height;
uint8_t *rgba;
kr_videoport_t *videoport_in;
kr_client_t *client_in;
int got_frame;
@oneman
oneman / em2rel.pl
Last active December 20, 2015 14:09 — forked from dsheeler/px2em.pl
#! /usr/bin/perl
while (<>) {
while (/([-.\d]+)(\s*)em/) {
$rel = $1 * 16;
$val = $1;
$s = $2;
s/$val\s*em/${rel}%/;
}
print;