Skip to content

Instantly share code, notes, and snippets.

@mortennobel
mortennobel / SingleFileOpenGLTex.cpp
Last active January 25, 2024 10:03
Single file OpenGL 3.3 / WebGL (using Emscripten) example with texture (SDL2 / SDL_Image 2)
//
// Compile for emscripten using
// emcc -Iinclude SingleFileOpenGLTex.cpp \
-O2 -std=c++14 -s TOTAL_MEMORY=33554432 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' --preload-file examples/data -s USE_SDL=2 -o html/SingleFileOpenGLTex.html
// where the following images must be located in a subfolder
// - examples/data/test.png
// - examples/data/cartman.png
// - examples/data/cube-negx.png
// - examples/data/cube-negz.png
//
//--------------------------------------
//--- 010 Editor Binary Template
//
// File: FSB5.bt
// Author: Simon Pinfold
// Purpose: Parses the FSB5 (v0 and v1) audio container.
//--------------------------------------
BitfieldDisablePadding();
@Overbryd
Overbryd / nginx.conf
Created March 27, 2012 22:22
Nginx configuration for a CouchDB reverse proxy, also very useful for hosting CouchApps
worker_processes 4;
events {
worker_connections 1024;
}
http {
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
@panicsteve
panicsteve / gist:1641705
Created January 19, 2012 18:26
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
Feature:
Background:
Given the year is 1972
And there is a crack commando unit
And that unit has been sent to prison by a "military court"
And it was a crime they did not commit
Scenario:
Given the men have escaped from a "maximum security stockade" to the "Los Angeles underground"
And today they are still wanted by the government
@jrom
jrom / thin_model.rb
Created June 16, 2011 09:55
Hack to create a new skinny model from an existing one
# By James Urquhart (jamesu)
class ActiveRecord::Base
def self.thin_model
table = table_name
@@thin_model ||= Class.new(superclass).tap do |anon|
anon.class_eval { set_table_name table }
end
end
end
.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');