Skip to content

Instantly share code, notes, and snippets.

View supr's full-sized avatar

supr

  • C|^_^|Ɔ
  • GU HQ, 21 Faro System.
View GitHub Profile
#include <stdio.h>
void a(){
char x[] = "aabbcc\0";
char y[] = "ccbbaa\0";
}
void b(){
char x[] = "ccbbaa\0";
char y[] = "aabbcc\0";
location /foo/([a-zA-Z0-9]+)/bar/([0-9]+) {
my_module on;
my_module_first $1;
my_module_second $2;
}
; boot.asm
; BIOS loads boot sector at 0000:7c00
mov ds, 0x07c0
mov ah, 0x0
mov al, 0x6a
int 0x10
xor cx, cx
begin:
@supr
supr / uz.c
Created October 11, 2012 07:07
uz nes enc
#include <sys/mman.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#define INDEX(B, P) ((P) - (B))
set-option -g status on
set-option -g status-interval 2
set-option -g status-utf8 on
set-option -g status-justify "centre"
set-option -g status-left-length 120
set-option -g status-right-length 90
set-option -g status-left "#(~/code/tmux-powerline/status-left.sh)"
set-option -g status-right "#(~/code/tmux-powerline/status-right.sh)"
object Telugu {
def main(args: Array[String]) = {
var a = 0;
for(a <- 0x0C01 to 0x0C39) {
print(a.toChar);
}
}
}
@supr
supr / strip.py
Last active December 12, 2015 07:09
import re
import sys
f = open(sys.argv[1])
content = f.read()
for i in filter(lambda x: not re.match(r'^#', x.strip()), re.split('startup|;', content)):
if i.strip():
print "startup" + i + ";"
@supr
supr / gist:5167384
Created March 15, 2013 03:58
nginx + unicorn escaping %2B
{{EPOLLIN|EPOLLOUT, {u32=36219585, u64=36219585}}}, 512, 65000) = 1
recvfrom(3, "GET /thor/zVB1j9zL6b%2BFZQ%252FP"..., 1024, 0, NULL, NULL) = 961
socket(PF_FILE, SOCK_STREAM, 0) = 10
ioctl(10, FIONBIO, [1]) = 0
epoll_ctl(8, EPOLL_CTL_ADD, 10, {EPOLLIN|EPOLLOUT|EPOLLET, {u32=36219777, u64=36219777}}) = 0
connect(10, {sa_family=AF_FILE, path="/home/web/sock.sock"}, 110) = 0
getsockopt(10, SOL_SOCKET, SO_ERROR, [152529956721655808], [4]) = 0
writev(10, [{"GET /thor/zVB1j9zL6b+FZQ%252FPLd"..., 981}], 1) = 981
recvfrom(3, 0x7fffc49d1c3f, 1, 2, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_wait(8, {{EPOLLIN|EPOLLOUT|EPOLLHUP, {u32=36219777, u64=36219777}}}, 512, 60000) = 1
@supr
supr / matrix_telugu.html
Created March 18, 2013 00:21
Matrix Telugu
<head>
<script>
<!--
var s,q,w,h,m,p,i;
function randomFromInterval(from, to) {
return Math.floor(m() * (to - from + 1) + from);
}