Skip to content

Instantly share code, notes, and snippets.

View jbenner-radham's full-sized avatar

James Benner jbenner-radham

View GitHub Profile
@jbenner-radham
jbenner-radham / README.md
Last active August 29, 2015 14:24 — forked from gre/README.md

"Panzer Dragoon 1k" is a 2D remake of Panzer Dragoon in 1k of JavaScript for JS1K 2014 by @greweb

Goal

Use your Dragoon to prevent enemies from escaping.

How to play

; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/1st.assignment/shell_bind_tcp.asm
global _start
section .text
_start:
; syscalls (/usr/include/asm/unistd_32.h)
; socketcall numbers (/usr/include/linux/net.h)
@jbenner-radham
jbenner-radham / poem.html
Last active August 29, 2015 14:22 — forked from elmimmo/poem.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Styling a poem</title>
<style type="text/css">
/* Left-aligned text in a centered block (mangles text in Adobe Digital Editions 1.7, so search an alternative if you need to support it) */
.poem {
display: table;
margin-right: auto;
@jbenner-radham
jbenner-radham / Makefile
Last active February 23, 2016 01:54 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@jbenner-radham
jbenner-radham / Makefile
Last active August 29, 2015 14:17 — forked from skeeto/Makefile
CFLAGS = -std=c99 -Wall
main : main.o
.PHONY : test clean
test : main
./$^ "*regex*" "*vtable*" < main.c
clean :
@jbenner-radham
jbenner-radham / resume.c
Last active August 29, 2015 14:17 — forked from klange/_.md
#include <stdio.h>
#include <time.h>
/* TODO: resume.h */
typedef struct {
char * company;
char * location;
char * title;
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
#!/usr/bin/env ruby -w
# brew-services(1) - Easily start and stop formulas via launchctl
# ===============================================================
#
# ## SYNOPSIS
#
# [<sudo>] `brew services` `list`<br>
# [<sudo>] `brew services` `restart` <formula><br>
# [<sudo>] `brew services` `start` <formula> [<plist>]<br>

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@jbenner-radham
jbenner-radham / winch.c
Last active August 29, 2015 14:12 — forked from clausecker/winch.c
#include <signal.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
static void winch_handler(int);
static void print_tdim(void);