Skip to content

Instantly share code, notes, and snippets.

@noonat
noonat / gist:1649543
Created January 20, 2012 21:02
Rake Quick Reference
# Rake Quick Reference
# by Greg Houston
# http://ghouston.blogspot.com/2008/07/rake-quick-reference.html
# -----------------------------------------------------------------------------
# Running Rake
# -----------------------------------------------------------------------------
# running rake from the command-line:
# rake --help
@noonat
noonat / cube.mtl
Created August 8, 2011 02:10
Cube OBJ and MTL file
newmtl cube
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.0000 0.0000 0.0000
Kd 0.5880 0.5880 0.5880
Ks 0.0000 0.0000 0.0000
window.sha1 = (function() {
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
* in FIPS 180-1
* Version 2.2 Copyright Paul Johnston 2000 - 2009.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for details.
*/
@noonat
noonat / extract_pak.c
Created August 5, 2011 14:13
Extract files from a Quake PAK
// Extract a PAK file (from Quake 1 and 2)
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
typedef struct {
char id[4];
@noonat
noonat / coreos-virtualbox.md
Last active February 10, 2023 22:00
Installing CoreOS on VirtualBox
  • Download and install VirtualBox.
  • Download the CoreOS ISO
  • Create a new VM in VirtualBox
    • For the OS, Other Linux, 64-bit should be fine
    • Give the VM 1gb of memory, like your physical hardware has.
    • Create a disk of whatever size you want. I made a VMDK file that could expand dynamically up to 8gb.
  • Mount the ISO in the VM
    • Right click on the VM and click settings
  • Go to the storage tab
@noonat
noonat / webrtc-data-channels.js
Last active April 11, 2022 18:02
WebRTC Data Channels
// This is a bare bones example of creating a data channel between two WebRTC
// peers. Let's imagine two peers trying to connect to each other. We'll call
// one the "offer peer", and the other the "answer peer". The offer peer will
// be the one initiating a connection, and the answer peer will be the one
// responding to it.
//
// The two peers must use a separate connection to negotiate their connection.
// A websocket connection to a shared server is often used for this negotiation.
// They will exchange offers and answers using the websocket. Each peer will
// also attempt to discover more details about themselves (ICE), such as their
@noonat
noonat / extract_swf.py
Created February 10, 2011 22:56
Extract potential SWF files from projector binaries
import os.path
import struct
import sys
import traceback
import zlib
if len(sys.argv) < 2:
print >> sys.stderr, "usage: %s <filename>" % sys.argv[0]
sys.exit(1)
filename = sys.argv[1]
@noonat
noonat / machine.js
Created May 7, 2010 03:19
JavaScript state machine
// Javascript state machine. Allows you to specify a number of routes
// and set a target state, and it will call through the routes to
// get there.
function Machine(defaultState, routes) {
this.target = undefined;
this.transition = undefined;
this.routes = typeof routes === 'function' ? routes() : routes;
// Set the state last, so the route will be triggered.
@noonat
noonat / gevent_threads.py
Created February 19, 2017 04:43
gevent + threads
"""This is an example of cooperating between a gevent hub and normal threads."""
import gevent
import socket as _socket
from gevent import hub, socket, _threading
conns = _threading.Queue()

Keybase proof

I hereby claim:

To claim this, I am signing this object: