This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var canvas; | |
var ctx; | |
var gameDiv =document.getElementById('game'); | |
canvas =document.createElement("canvas"); | |
gameDiv.appendChild(canvas); | |
canvas.width = 600; | |
canvas.height = 475; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function async(your_function, callback) { | |
setTimeout(function() { | |
your_function(); | |
if (callback) {callback();} | |
}, 0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |