Skip to content

Instantly share code, notes, and snippets.

View arjankuijpers's full-sized avatar

Arjan Kuijpers arjankuijpers

View GitHub Profile
@arjankuijpers
arjankuijpers / rotate image in canvas with javascript HTML5
Created August 31, 2013 20:07
rotate image inside HTML5 canvas, it will rotate and directly draw the image to the canvas, without saving and restoring the cordination of the context (ctx.save() & ctx.restore() ).
var canvas;
var ctx;
var gameDiv =document.getElementById('game');
canvas =document.createElement("canvas");
gameDiv.appendChild(canvas);
canvas.width = 600;
canvas.height = 475;
function async(your_function, callback) {
setTimeout(function() {
your_function();
if (callback) {callback();}
}, 0);
}
@arjankuijpers
arjankuijpers / fps - tick counter
Created November 5, 2014 00:38
fps / tick counter with settable average, ported it from somebody (on the web) that wrote it in a typesafe language..
//cant use const because of IE9, IE9 does not support const.
var MAXSAMPLES = 100;
var tickindex=0
var ticksum=0;
var ticklist = [];
for(var i = 0; i < MAXSAMPLES; i++)
{
ticklist[i] = 0;
@arjankuijpers
arjankuijpers / NerderyVPN.bat
Created July 30, 2016 16:48 — forked from adrienne/NerderyVPN.bat
A batch file to connect to the VPN and mount the network storage as a drive
@echo off
if exist n:\home goto DISCONNECTME else goto CONNECTME
:CONNECTME
REM NOTE: in all of the below variables EXCEPT for mydrivename , double-quote the values!
REM This is the name of the VPN you've got set up
set myvpnname="Name of your VPN connection"
@arjankuijpers
arjankuijpers / Output iOS Icons.jsx
Last active September 4, 2016 13:13 — forked from tlinkner/Output iOS Icons.jsx
Photoshop script to output iOS icons, now with iOS 9 sizes
// Output iOS Icons.jsx
// 2014 Todd Linkner
// License: none (public domain)
// v1.2
//
// This script is for Photoshop CS6. It outputs iOS icons of the following
// sizes from a source 1024px x 1024px PSD
//
// [name]-29.png
// [name][email protected]
@arjankuijpers
arjankuijpers / current time stamp linux
Created February 25, 2017 20:39
current time stamp
long long current_timestamp() {
struct timeval te;
gettimeofday(&te, NULL); // get current time
long long milliseconds = te.tv_sec*1000LL + te.tv_usec/1000; // caculate milliseconds
// printf("milliseconds: %lld\n", milliseconds);
return milliseconds;
}