Skip to content

Instantly share code, notes, and snippets.

View halfvector's full-sized avatar
😄

Alex Barkan halfvector

😄
View GitHub Profile
@halfvector
halfvector / keybase.md
Created August 14, 2014 00:17
keybase.md

Keybase proof

I hereby claim:

  • I am halfvector on github.
  • I am unbuffered (https://keybase.io/unbuffered) on keybase.
  • I have a public key whose fingerprint is 06A0 B06E C8DA 531E D77F 7C6A 0671 385C D805 BB2D

To claim this, I am signing this object:

@halfvector
halfvector / update-android-id.sh
Created July 16, 2014 17:09
update device's android_id
# prerequisites: rooted device, adb, sqlite installed locally
# works beautifully on glass
# android-ids are hexadecimal [0-9a-f]
# install sqlite3 locally to modify the db
sudo apt-get install -y sqlite3
# make sure we have a device connected
adb devices
@halfvector
halfvector / gist:9732963
Last active August 29, 2015 13:57
playing various form-gathering syntaxes
$data = $this->getRequirements([
'description' => ['type' => 'markdown', 'minLength' => 3, 'persistent' => true],
'title' => ['type' => 'string', 'minLength' => 3, 'persistent' => true],
'action' => ['type' => 'string', 'minLength' => 3],
'suggestionId' => ['type' => 'int'],
'reason' => ['type' => 'string', 'minLength' => 3, 'optional' => true, 'default' => ""],
'tags' => ['type' => 'array', 'optional' => true],
'attachments' => ['type' => 'file', 'optional' => true],
'keepAttachments' => ['type' => 'array', 'optional' => true]
]);
@halfvector
halfvector / ogg-vorbis-encoder.cpp
Created February 20, 2014 01:34
Ogg+Vorbis encoder, designed to be compiled by Emscripten and used in browsers.
#include <stdio.h> // printf
#include <math.h> // sin
#include <time.h> // time
#include <stdlib.h> // srand
#include <string.h> // memcpy
#include <vorbis/vorbisenc.h>
struct tEncoderState
{