Skip to content

Instantly share code, notes, and snippets.

View subzey's full-sized avatar

Anton Khlynovskiy subzey

View GitHub Profile
@subzey
subzey / index.html
Last active August 29, 2015 14:20
Too Asynchronous
<!DOCTYPE html>
<html lang="en">
<head>
<title>Async test</title>
<meta charset="utf-8">
</head>
<body>
<pre></pre>
<script>
<!DOCTYPE html>
<html>
<head>
<title>@document demo</title>
<style>
body {
text-align: center;
}
.foo {
margin: .5em;
@subzey
subzey / index.html
Created September 21, 2015 17:34
Canvas paint test
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div>
<select id="type">
<option value="naive">Naive</option>
<option value="onefill">Fill once</option>
@subzey
subzey / main.js
Last active November 12, 2015 19:09
Sample library code organization
// Nothing.
@subzey
subzey / script.js
Created January 15, 2016 20:04
The ES6 way to IIFE
'use strict'; // V8 only can only use block scopes in strict mode so far.
var a = 42; // Variables outside may be defined in any way you want.
{ // The block starts. Yeah, we can just start a new block anywhere we want.
let a = 'Oh, hi!'; // Define a block scoped variable using let.
console.log(a); // Use it.
} // The block ends, and all the block scoped variables dies.
console.log(a); // Left untouched.
@subzey
subzey / readme.md
Created March 24, 2016 12:06
Frogs puzzle video is wrong

Frogs puzzle video is wrong

First, watch the video.

Frogs distribution is defined purely randomly. It is done before the frog croaks and way before you decide where to go. Your decision can not change the initial distribution.

There are 8 cases:

@subzey
subzey / readme.md
Last active April 11, 2016 21:38
RND.JS transcript

Here's an english transcript of my talk on RND.JS

Slide

On the slide: "Inserting like Google"

Today I'm going to talk about the embeds. It is when the page contains parts included from the third-party website.

Slide

On the slide: Weather forecast informer

'use strict';
const propNames = [
"canvas",
"drawingBufferWidth",
"drawingBufferHeight",
"activeTexture",
"attachShader",
"bindAttribLocation",
"bindBuffer",
@subzey
subzey / index.html
Created June 16, 2016 21:55
Water Lilies
<!-- 122 bytes -->
<canvas id=a><svg onload=c=a.getContext`2d`;setInterval`for(a.width|=j=38;j--;c.arc(j*9,9,8,i+2,i--${i=40}1));c.stroke()`>
@subzey
subzey / index.html
Created August 21, 2016 21:55
glitchy
<title>Glitchy test</title>
<body style=height:100%;margin:0;overflow:hidden bgcolor=0>
<canvas id=a style=display:block;margin:auto>
<script>
var b = document.body;
// Initing the webgl
var gl = a.getContext('webgl');
gl.enable(gl.DEPTH_TEST);