Skip to content

Instantly share code, notes, and snippets.

View victusfate's full-sized avatar
🚀

Mark Essel victusfate

🚀
View GitHub Profile
@mikeyk
mikeyk / gist:1329319
Created October 31, 2011 22:56
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
@bertrandom
bertrandom / westernunion.js
Created November 18, 2011 21:32
Daemon for queueing tasks for the future for Gearman without using SUBMIT_JOB_EPOCH
require('js-yaml');
function writeLn(line) {
var now = new Date();
console.log(now.toGMTString() + ' - [' + jobs + '] - ' + line);
}
function executeJob(data) {
if (!connection_working) {
@daien
daien / video_stabilize.py
Created January 2, 2012 18:23
Video stabilization with OpenCV and Hugin
#!/usr/bin/env python
""" Video stabilization with OpenCV (>=2.3) and Hugin
Adrien Gaidon
INRIA - 2012
TODO: add cropping, clean-up and improve doc-strings
"""
@jamiehodge
jamiehodge / app.rb
Created January 12, 2012 09:50
Sinatra API for resumable.js
require 'sinatra'
require 'slim'
require 'coffee-script'
require 'sass'
require 'sequel'
DB = Sequel.sqlite
DB.create_table :uploads do
String :id, text: true, primary_key: true
@boredzo
boredzo / gist:1696100
Created January 28, 2012 22:57
Creating font(s) from a URL
//Core Graphics method
CGDataProviderRef provider = CGDataProviderCreateWithURL((__bridge CFURLRef)fontURL);
CGFontRef graphicsFont = CGFontCreateWithDataProvider(provider);
CTFontRef coreTextFont = CTFontCreateWithGraphicsFont(graphicsFont, fontSize, /*matrix*/ NULL, /*attributes*/ NULL);
if (coreTextFont) {
NSFont *font = (__bridge NSFont *)coreTextFont;
[fonts addObject:font];
CFRelease(coreTextFont);
}
CGFontRelease(graphicsFont);
@dougalcampbell
dougalcampbell / utfluv.js
Created March 12, 2012 19:44
Handle invalid JS character sequences
/**
* encode to handle invalid UTF
*
* If Chrome tells you "Could not decode a text frame as UTF-8" when you try sending
* data from nodejs, try using these functions to encode/decode your JSON objects.
*
* see discussion here: http://code.google.com/p/v8/issues/detail?id=761#c8
* see also, for browsers that don't have native JSON: https://github.com/douglascrockford/JSON-js
*
* Any time you need to send data between client and server (or vice versa), encode before sending,
@schlamar
schlamar / processify.py
Last active March 12, 2025 19:37
processify
import os
import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.
Be sure that every argument and the return value
@nex3
nex3 / gist:2354053
Created April 10, 2012 19:57
Haml call for maintainer

It's become increasingly apparent that between my full-time job and my work on Sass, I don't have the cycles any more to properly maintain Haml. I'd like to pass on the mantle to someone else, but I don't want to do it blindly.

If you're interested in becoming the maintainer of Haml, please demonstrate this by creating a fork of the repo and starting the maintenance process of addressing the issues and code-reviewing and merging pull requests into your fork. What I'm looking for is evidence that you'll be more diligent than I currently can, as well as the ability to both write good code and get good code from other contributors.

In a week or so, if anyone's taken up this challenge and done well, I'll hand them the reins.

  • Nathan Weizenbaum, Haml maintainer
@roxlu
roxlu / testApp.cpp
Created May 24, 2012 07:36
Basic bare bones openGL with openFrameworks (VBO, VAO, SHADER and texture(s))
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
ofEnableNormalizedTexCoords();
ofDisableArbTex();
ofSetFrameRate(60);
ofBackground(22,33,44);
// Shader + VAO/VBO
@djcsdy
djcsdy / LICENSE.txt
Created June 5, 2012 15:04 — forked from p01/LICENSE.txt
Music SoftSynth
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE