Skip to content

Instantly share code, notes, and snippets.

View zeroeth's full-sized avatar
🤖
🐱 🤖 🐱 🤖

[0] zeroeth

🤖
🐱 🤖 🐱 🤖
View GitHub Profile
@zeroeth
zeroeth / gitignore
Created January 7, 2015 17:26
unity multi user project/git settings.
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
# Autogenerated VS/MD solution and project files
/*.csproj
/*.unityproj
/*.sln
/*.suo
@zeroeth
zeroeth / nowhales.js
Last active August 29, 2015 14:11
hide the wiki banner after donating
// This is a Tampermonkey script.
// ==UserScript==
// @name no whales
// @namespace pixelflow
// @version 0.0
// @description hide the whales
// @author zeroeth
// @match http://*.wikipedia.org/*
// @grant GM_addStyle
@zeroeth
zeroeth / render_page.sh
Created December 10, 2014 18:25
js cache invalidator
#!/bin/sh
# Helper for conditional inclusion of features.
function command_exists() {
type "$1" &> /dev/null ;
}
file_signature() {
if command_exists sha256
then
@zeroeth
zeroeth / vbofun.cpp
Created December 10, 2014 04:44
bare minimum vbo example
GLuint triangleVBO;
//Vertices of a triangle (counter-clockwise winding)
//float data[] = {1.0, 0.0, 1.0, 0.0, 0.0, -1.0, -1.0, 0.0, 1.0};
float data[] = {0.0, 1.0, 0.0, -1.0, -1.0, 0.0, 1.0, -1.0, 0.0};// if the above doesn't work.
//Create a new VBO and use the variable id to store the VBO id
glGenBuffers(1, &triangleVBO);
@zeroeth
zeroeth / glversion.cpp
Created December 1, 2014 02:31
gl version check
// get version info
const GLubyte* renderer = glGetString (GL_RENDERER); // get renderer string
const GLubyte* version = glGetString (GL_VERSION); // version as a string
printf ("Renderer: %s\n", renderer);
printf ("OpenGL version supported %s\n", version);
[url, height, width, output_dir] = phantom.args
console.log("url #{url}, height #{height}, width #{width}, output_dir #{output_dir}")
page = require('webpage').create()
page.viewportSize =
width: width
height: height
page.onConsoleMessage = (msg) ->
@zeroeth
zeroeth / .bashrc
Last active August 29, 2015 14:07 — forked from clneagu/.bashrc
# Call virtualenvwrapper's "workon" if .venv exists. This is modified from--
# http://justinlilly.com/python/virtualenv_wrapper_helper.html
# which is linked from--
# http://virtualenvwrapper.readthedocs.org/en/latest/tips.html#automatically-run-workon-when-entering-a-directory
check_virtualenv() {
if [ -e .venv ]; then
env=`cat .venv`
if [ "$env" != "${VIRTUAL_ENV##*/}" ]; then
echo "Found .venv in directory. Calling: workon ${env}"
workon $env
@zeroeth
zeroeth / we_are_the_mods.c
Created October 1, 2014 14:36
C modulus operator for negative numbers
#include <stdio.h>
#include <assert.h>
int modulo(int dividend, int divisor)
{
int remainder = dividend % divisor;
if(remainder < 0) {
return remainder + divisor;
}
@zeroeth
zeroeth / wat.txt
Created September 18, 2014 04:29
mod out
C:
4 % 15 = 4
4 % -15 = 4
-4 % 15 = -4
-4 % -15 = -4
Ruby:
4 % 15 = 4
4 % -15 = -11
-4 % 15 = 11