Skip to content

Instantly share code, notes, and snippets.

View dte's full-sized avatar
💭
dreaming

Dillon Erb dte

💭
dreaming
View GitHub Profile
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#
@rmanalan
rmanalan / .gems
Created January 25, 2010 20:54
Static websites using Heroku
rack-contrib
rack-rewrite
@implementation NSString (HexStuff)
- (NSUInteger)hexValue
{
NSUInteger i = 0;
// -- strip leading #
if( [self hasPrefix:@"#"] )
i++;
@matiskay
matiskay / README.md
Created December 29, 2011 21:24 — forked from lenary/partials.rb
Partials on Sinatra + Haml

Partials on Sinatra + Haml

This is the haml version. If you want to use the same with erb just change haml to erb.

How to use it

  • Create you partial form example _form.haml (The underscore at the beginning is really important).
  • In you .haml file just write = partial("form").
@praeclarum
praeclarum / n3mtodae.c
Created January 21, 2012 06:55
Converts Nokia 3D models to DAE models (http://maps3d.svc.nokia.com/webgl/index.html)
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
struct xyz
{
float x, y, z;
@gpavlidi
gpavlidi / n3mtodae.c
Created February 4, 2012 23:19 — forked from praeclarum/n3mtodae.c
Converts Nokia 3D models to textured DAE models (http://maps3d.svc.nokia.com/webgl/index.html)
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include <Share.h>
#include <math.h>
@paolorossi
paolorossi / html5-video-streamer.js
Created March 7, 2012 13:21
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@lrvick
lrvick / bitcolor.js
Created March 18, 2012 20:02
Javascript functions for doing fast binary/hex/RGB color conversions using bitwise operations.
// convert 0..255 R,G,B values to binary string
RGBToBin = function(r,g,b){
var bin = r << 16 | g << 8 | b;
return (function(h){
return new Array(25-h.length).join("0")+h
})(bin.toString(2))
}
// convert 0..255 R,G,B values to a hexidecimal color string
RGBToHex = function(r,g,b){
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@claus
claus / BitStream.js
Created May 29, 2012 17:37
A simple Uint8Array based bitstream JavaScript class
// Usage:
// var buf = new Uint8Array(128);
// var bitstream = new BitStream(buf);
// bitstream.writeBits(12, 0xffff);
// bitstream.seekTo(0);
// bitstream.readBits(6); // 111111
// bitstream.readBits(10); // 1111110000
window.BitStream = function(uint8Array) {