Skip to content

Instantly share code, notes, and snippets.

View wridgers's full-sized avatar

Will Ridgers wridgers

View GitHub Profile
PS D:\Dev\projects\john\bin> Measure-Command { .\debug\john.exe }
Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 600
Ticks : 6008259
TotalDays : 6.95400347222222E-06
#!/usr/bin/python
import os, time, sys
now = time.time()
errorFiles = open('errors.txt', 'w')
playlist01days = open('Last 1 day.m3u', 'w')
playlist07days = open('Last 7 days.m3u', 'w')
playlist14days = open('Last 14 days.m3u', 'w')
@echo off
setlocal EnableDelayedExpansion
set EXT_LIST=(c cpp css h hs js pl py sh xml log markdown md text txt conf json)
ftype txtfile="C:\Program Files (x86)\Vim\vim73\gvim.exe" --remote-silent "%%1"
for %%e in %EXT_LIST% do (
assoc .%%e=txtfile
REG ADD "HKEY_CLASSES_ROOT\.%%e" /f /ve /d "txtfile"
REG ADD "HKEY_CLASSES_ROOT\.%%e" /f /v "Content Type" /d "text/plain"
void Tracer::trace()
{
// camera setup
Vector3 cameraLocation(0, 0, -800);
// light setup
double lightIntensity = 100.0;
Vector3 lightLocation(0, 500, 0);
for (int screenIndex = 0; screenIndex < Tracer::screenBufferSize; ++screenIndex ) {
bool Tracer::loadExampleScene()
{
// render settings
// lighting settings
Tracer::useAmbientLighting(true);
Tracer::setAmbientLightingColour(Colour(255, 255, 255));
Tracer::setAmbientLightingIntensity(0.05);
// lights
@wridgers
wridgers / header.tex
Last active December 10, 2015 21:08
\documentclass[a4paper]{article}
% variables! for nice stuff.
\newcommand{\documentTitle}{TITLE OF YOUR DOCUMENT}
\newcommand{\documentAuthor}{YOUR NAME}
\newcommand{\documentDate}{\today}
% unicode please
\usepackage[utf8]{inputenc}
@wridgers
wridgers / gist:4277600
Created December 13, 2012 16:22
Writes a BMP format file.
void Tracer::writeScreenToBmp()
{
// short == 2 bytes
// int == 4 bytes
struct BitMapFileHeader
{
short magic;
int size;
short reserved1;
@wridgers
wridgers / MCAPI.php
Created October 18, 2012 12:15
MCAPI - patched by wridgers
<?php
// MCAPI - patched by wridgers (https://github.com/wridgers)
// This patch makes the MCAPI OO friendly, and easy to integrate into projects like Symfony2.
namespace MailChimp;
class MCAPI {
public $version = "1.3";
public $errorMessage;
import android
import datetime
import json
import urllib
droid = android.Android()
# Configuration options
name = "YOUR_NAME"
weatherSearch = "A_CODE" # UK post code, US zip code, lat/lon
" disable those fuckin' arrow keys
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>