Skip to content

Instantly share code, notes, and snippets.

View dte's full-sized avatar
💭
dreaming

Dillon Erb dte

💭
dreaming
View GitHub Profile
@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) {
@lg
lg / cloudy-gamer-launcher.sh
Last active April 28, 2021 14:25
Easily start/stop Paperspace and Parsec instances
#!/bin/bash
#
# CloudyGamerLauncher by Larry Gadea
# Easily start/stop Paperspace and Parsec instances
#
# Make sure to fill out the variables below. For the machine id, use the
# 8-letter identifier for the machine on Paperspace (ex. PS8RGDUY)
#
# Note: Requires Paperspace API key (generate one in account settings)
(ns scottdw.plot.demo
(:import [java.util Random]
[org.jzy3d.analysis AnalysisLauncher AbstractAnalysis]
[org.jzy3d.chart Chart]
[org.jzy3d.chart.factories AWTChartComponentFactory]
[org.jzy3d.colors Color ColorMapper]
[org.jzy3d.colors.colormaps ColorMapRainbow]
[org.jzy3d.maths Coord3d Range]
[org.jzy3d.plot3d.builder Builder Mapper]
[org.jzy3d.plot3d.builder.concrete OrthonormalGrid]
@geta6
geta6 / partial.coffee
Created September 27, 2012 10:13
response partial content in node.js
#
# blob : Object from MongoDB
#
# blob.body: Buffer
# blob.size: length of buffer, substitute for blob.body.length
# blob.type: MIME (Eg. audio/x-wav)
#
# req : Object from http
# res : Object from http
# _ : Object from underscore
@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").
@ceejbot
ceejbot / proposal.md
Last active November 25, 2015 21:13
monitoring proposal

Go here for the latest + some code.

numbat

An alerting engine for a metrics & monitoring system.

This is the same approach I wanted in my initial spike, only instead of writing a custom collector & using an existing alerting engine (riemann), I'm proposing using an existing collector (hekad) and writing the alerting engine.

The system

@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>
@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;
@implementation NSString (HexStuff)
- (NSUInteger)hexValue
{
NSUInteger i = 0;
// -- strip leading #
if( [self hasPrefix:@"#"] )
i++;
@rmanalan
rmanalan / .gems
Created January 25, 2010 20:54
Static websites using Heroku
rack-contrib
rack-rewrite