Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
function a(x,y){
y = function() { x = 2; };
return function(){
var x = 3;
y();
console.log(x);
}.apply(this, arguments);
}
a();
// Cross-browser but not absolutely strong.
function isArguments( obj ) {
return typeof obj === "object" && ( "callee" in obj ) && typeof obj.length === "number";
}
// Ideally strong, but broken on Opera...
var isArguments = (function( undefined ) {
@SiZapPaaiGwat
SiZapPaaiGwat / interval.js
Last active August 29, 2015 14:19 — forked from manast/interval.js
add ES6 support
export default function timer(fn, duration) {
this.baseline = 0
this.run = function(exec){
if(!this.baseline){
this.baseline = Date.now()
}
exec && fn()

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n
@SiZapPaaiGwat
SiZapPaaiGwat / base64encode.js
Created September 7, 2015 07:43
simple base64 encode relied on window.btoa
function base64Encode( str ) {
str = str.replace( /[^\x00-\x7F]/g, function ( char ) {
var hex = char.charCodeAt( 0 ).toString( 16 );
while ( hex.length < 4 ) hex = '0' + hex;
return '\\u' + hex;
});
return btoa( str );
}
@SiZapPaaiGwat
SiZapPaaiGwat / ajax-button.html
Created September 7, 2015 08:05
single file ractive component
<button on-click="{{loading ? '' : 'request'}}" type="{{type || 'button'}}"
class="{{className}}" {{#if disable}} disable {{/if}}>
{{#if loading}}
{{loadingText}}
{{else}}
{{text}}
{{/if}}
</button>
<script>

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () =&gt; x) {

Interesting part (unmounting & API) is at the end if you're not interested in the rest =).

Stress Tests

This animation proposal is just an attempt. In case it doesn't work out, I've gathered a few examples that can test the power of a future animation system.

  1. Parent is an infinitely spinning ball, and has a child ball that is also spinning. Clicking on the parent causes child to reverse spinning direction. This tests the ability of the animation system to compose animation, not in the sense of applying multiple interpolations to one or more variables passed onto the child (this should be trivial), but in the sense that the parent's constantly updating at the same time as the child, and has to ensure that it passes the animation commands correctly to it. This also tests that we can still intercept these animations (the clicking) and immediately change their configuration instead of queueing them.

  2. Typing letters and let them fly in concurrently. This tests concurrency, coordination of an array of ch