Skip to content

Instantly share code, notes, and snippets.

View maxrp's full-sized avatar

Max P maxrp

View GitHub Profile
// HTTP client for testing high connection concurrency
// Authors: Richard Jones and Rasmus Andersson
// Released in the public domain. No restrictions, no support.
#include <sys/types.h>
#include <sys/time.h>
#include <sys/queue.h>
#include <stdlib.h>
#include <err.h>
#include <event.h>
#include <evhttp.h>
@koenbollen
koenbollen / punch.py
Created July 5, 2010 19:10
Proof of Concept: UDP Hole Punching
#!/usr/bin/env python
#
# Proof of Concept: UDP Hole Punching
# Two client connect to a server and get redirected to each other.
#
# This is the client.
#
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
@KenMacD
KenMacD / cmd.md
Created October 7, 2011 02:41
GPG Offline Master Key
@codeforkjeff
codeforkjeff / solarize.sh
Created November 27, 2011 06:43
shell script for setting gnome-terminal color palette to use Solarized theme
#!/bin/sh
#
# Shell script that configures gnome-terminal to use solarized theme
# colors. Written for Ubuntu 11.10, untested on anything else.
#
# Solarized theme: http://ethanschoonover.com/solarized
#
# Adapted from these sources:
# https://gist.github.com/1280177
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/
@musiKk
musiKk / fileviewer.py
Created April 15, 2012 12:40
Tiny file browser in GTK3
#!/usr/bin/env python2
from gi.repository import Gtk, GObject, GLib
import os
import os.path
class File(object):
def __init__(self, file_name, place_holder=False, directory=True, root=False, empty=False):
self.file_name = file_name
@jedisct1
jedisct1 / tweetnacl-indented.c
Last active November 12, 2022 18:02
Indented version of @TweetNacl
#include "tweetnacl.h"
#define FOR(i,n) for (i = 0;i < n;++i)
#define sv static void
typedef unsigned char u8;
typedef unsigned int u32;
typedef unsigned long long u64;
typedef long long i64;
typedef i64 gf[16];

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
#!/bin/sed -rf
# How to run:
# echo 'A A<1+B1-C>B<1-A1+B>D<1-B1qC> 0<0>0'
# Note: Your local sed may use a different flag for "extended" regexes; this is written for GNU sed.
#
# tape: [active-state] " " (state-name "<" (write move next-state)_0 (write move next-state)_1 ">")* " " tape... "<" curpos ">" tape...
# State names can be any character not in " <>".
# The tape consists of 0's and 1's.
# The "move" field can be "-" to move left, "+" to move right, or "q" to halt.
@umbrellaprocess
umbrellaprocess / gist:973d2aa16e95bf329ee2
Last active December 16, 2021 08:53
A simple example of MIDI Keyboard for SuperCollider 3.6.x
/**
* A simple example of MIDI Keyboard for SuperCollider 3.6.x
*/
MIDIIn.connect;
s.boot;
(
SynthDef("umbSinewave",{
arg freq=440, gate=1, amp=1, pan=0;
@umbrellaprocess
umbrellaprocess / gist:7a4ffe994765fc195d95
Created August 16, 2014 04:38
Just intonation MIDI keyboard with SuperCollider
/**
* Just intonation MIDI keyboard with SuperCollider
*/
MIDIIn.connect;
s.boot;
(
SynthDef("umbSimpleFM",{
arg freq=440, gate=1, amp=1, pan=0;