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
<dict> | |
<key>name</key> | |
<string>Git Modified Line</string> | |
<key>scope</key> | |
<string>git.changes.x</string> | |
<key>settings</key> | |
<dict> | |
<key>background</key> | |
<string>#212340</string> | |
</dict> |
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
<head> | |
... | |
<!-- source files for development --> | |
<!-- <script src="src/setup.js"></script> --> | |
<!-- <script src="src/player.js"></script> --> | |
<!-- <script src="src/enemy.js"></script> --> | |
<!-- <script src="src/bullet.js"></script> --> | |
<!-- <script src="src/explosion.js"></script> --> | |
<!-- concatenated / minified source for production --> |
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 state = [{ | |
id: 0, | |
transform: { | |
position: { | |
x: 15.290663048624992, | |
y: 2.0000000004989023, | |
z: -24.90756910131313 | |
}, | |
rotation: { | |
x: 0.32514392007855847, |
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 char = new Int8Array( 1 ); | |
// uchar now shares the same ArrayBuffer as char. | |
var uchar = new Uint8Array( char.buffer ); | |
char.buffer === uchar.buffer; // true | |
char[0] = -1; | |
uchar[0] === 255; // true, same data interpreted differently | |
var arr = new Float64Array([15.290663048624992]); |
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
// Compact the state. | |
var slimmerState = new Float64Array([ | |
0, | |
15.290663048624992, | |
2.0000000004989023, | |
-24.90756910131313, | |
0.32514392007855847, | |
-0.8798439564294107, | |
0.32514392007855847, | |
0.12015604357058937, |
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 encodeUint8 = (function() { | |
var arr = new Uint8Array( 1 ); | |
return function( number ) { | |
// If we assume that the number passed in | |
// valid, we can just use it directly. | |
// return String.fromCharCode( number ); | |
arr[0] = number; | |
return String.fromCharCode( arr[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
// Shared code | |
var MsgType = { | |
"game start": String.fromCharCode(0), | |
"update state": String.fromCharCode(1), | |
"private message": String.fromCharCode(2) | |
}; | |
var MsgTypeLookup = [ | |
"game start", | |
"update state", |
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 msg = JSON.stringify( state ); | |
var getUTF8Size = function( str ) { | |
var sizeInBytes = str.split('') | |
.map(function( ch ) { | |
return ch.charCodeAt(0); | |
}).map(function( uchar ) { | |
// The reason for this is explained later in | |
// the section “An Aside on Text Encodings” | |
return uchar < 128 ? 1 : 2; |
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 slimState = [[ | |
0, | |
15.290663048624992, | |
2.0000000004989023, | |
-24.90756910131313, | |
0.32514392007855847, | |
-0.8798439564294107, | |
0.32514392007855847, | |
0.12015604357058937 | |
], [ |
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
<!doctype html> | |
<html> | |
<head> | |
<title>vertical centering 4 lyfe</title> | |
<link href='http://fonts.googleapis.com/css?family=Handlee' rel='stylesheet' type='text/css'> | |
<style> | |
html { | |
height: 100%; | |
} |