Skip to content

Instantly share code, notes, and snippets.

View subzey's full-sized avatar

Anton Khlynovskiy subzey

View GitHub Profile
@subzey
subzey / requiem.md
Last active August 29, 2015 13:58
Requiem for a Dragon

Requiem for a Dragon

This is post-mortem for my first JS1K entry, Breath.

Complete, almost per-line, explaination was subitted with uncompressed de-optimized source code. So it's not so "techy", this is something I would share with other coders after few beers in a bar. No code, just thoughts.

The Idea

@subzey
subzey / banner-insert.js
Created April 17, 2014 09:29
Пример асинхронной вставки
(function(){
var allScripts = document.getElementsByName('script');
var link = document.createElement('a');
for (var i=allScripts.length; i--; ){ // старый добрый ECMA 262-3
// Проходим по всем скриптам
var script = allScripts[i];
if (!script.src){
continue;
}
// определяем, подходит ли этот элемент script по его src
@subzey
subzey / dson.js
Last active August 29, 2015 14:02
DSON shim
var DSON = DSON || {
parse: function(v) {
return JSON.parse(v.replace(/"(\\"|[^"])*"|[a-z]+/gi, function(v) {
return {
such: '{',
wow: '}',
is: ':',
so: '[',
many: ']',
next: ',',
@subzey
subzey / toms.js
Created September 27, 2014 08:10
var toMs = (function (){
function _add(a, b){
var v = new Number((a || 0) + (b || 0));
v.milliseconds = milliseconds;
v.seconds = seconds;
v.minutes = minutes;
v.hours = hours;
v.days = days;
return v;
}
@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 / LICENSE.txt
Created June 5, 2011 08:07 — forked from bytespider/LICENSE.txt
140byt.es -- encodeURIComponent based convert string to array of UTF-8 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@subzey
subzey / ru_RU.md
Created July 4, 2011 11:29
Extended Pragma usage initiative

Инициатива расширенного использования заголовка HTTP Pragma

Назначение

Этот документ является выражением инциативы расширенного использования заголовка Pragma для указания серверу явным образом возможностей и предпочтений пользователя, касающихся представления и поведения документа HTML.

Этот документ не является нормативным.

@subzey
subzey / LICENSE.txt
Created July 8, 2011 14:52 — forked from 140bytes/LICENSE.txt
deMorse: Morse code → text
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 subzey <subzey@immelman.ru>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE