Skip to content

Instantly share code, notes, and snippets.

View audionerd's full-sized avatar

Eric Skogen audionerd

View GitHub Profile
@sansumbrella
sansumbrella / remove_if.cpp
Created November 26, 2012 15:21 — forked from cporter/remove_if.cpp
remove_if and vector
// -*- compile-command: "clang++ -std=gnu++0x -stdlib=libc++ -o remove_if remove_if.cpp" -*-
#include <iostream>
#include <vector>
using std::cout;
using std::endl;
int main (int, char **) {
std::vector<int> ints = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
cout << "Range-based for loop:" << endl;
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no

Key-Value Store

Simplest key-value store that is usable (I think). Uses the stdlib [PStore][ps] for storage which is not suited to storing large pieces of data, but isn't that the point of a key-value store?

GET / returns a json encoded array of keys (each as strings).

POST /

@igrigorik
igrigorik / hello_name.soy
Created August 21, 2011 05:58
Soy/closure-templates compilation via Ruby / JRuby
{namespace examples.simple}
/**
* Greets a person using "Hello" by default.
* @param name The name of the person.
* @param? greetingWord Optional greeting word to use instead of "Hello".
*/
{template .hello}
{if not $greetingWord}
Hello {$name}!
@jeresig
jeresig / .vimrc
Created May 4, 2011 16:46
VIM Config
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
set nocompatible
set autoindent
set tabstop=2
set showmatch
set vb t_vb=
set ruler
set nohls
set incsearch
syntax on
@sansumbrella
sansumbrella / repeatingTexture.cpp
Created April 25, 2011 01:30
Draw a repeating image in openGL with Cinder types
void drawRepeatingTexture( const gl::Texture& tex, const Rectf& destRect, const Vec2f& textureBounds )
{
tex.enableAndBind();
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
GLfloat verts[8];
GLfloat texCoords[8];
glVertexPointer( 2, GL_FLOAT, 0, verts );
@jeremyfromearth
jeremyfromearth / PixelBounds.cpp
Created April 22, 2011 05:34
Generate pixel bounds for Cinder Texture #pixelbounds #cinder #opengl #texture #collision-detection
//
// PixelBounds.cpp
// Demonstrates calculating the actual pixel bounds ( non-transparent bounds ) for a texture in Cinder
// More information here: http://wp.me/pPFvc-42
//
#include <cinder/app/AppBasic.h>
#include <cinder/Font.h>
#include <cinder/Text.h>
#include "cinder/gl/Texture.h"
@seven1m
seven1m / sass_with_jammit.rb
Created April 13, 2011 20:59
SASS with Jammit
# hack to auto compile sass when Jammit runs in Dev/Test mode
require 'haml/util'
require 'sass/engine'
module Jammit
module Helper
SASS_TIMESTAMPS = {}
def include_stylesheets_with_sass(*packages)
@jeremy
jeremy / schema.xml
Created April 2, 2011 00:53
Basecamp Solr schema
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="basecamp" version="1.3">
<types>
<!-- indexed/stored verbatim -->
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<!-- "true" or "false" -->
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<!-- binary data, base64 -->
@treyhunner
treyhunner / screenshot.sh
Created March 29, 2011 14:59
Grab a screenshot, give it a public dropbox URL, shorten the URL, and copy it to the clipboard
#!/bin/sh
# Ubuntu-specific modification of http://wiki.dropbox.com/TipsAndTricks/ShareScreenshots
# Change these
DB_USER_ID=YOURDBUSERID
BITLY_USERNAME=YOURBITLYUSERNAME
BITLY_API_KEY=YOURBITLYKEYHERE
DROPBOX_PUBLIC_DIR=~/Dropbox/Public
SCREENSHOT_DIR=screenshots