Skip to content

Instantly share code, notes, and snippets.

@kirjavascript
kirjavascript / index.html
Last active December 20, 2015 00:08
AoC #18
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head><title>GoL</title></head>
<body></body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<script>
/*
created by snkenjoi/kirjava/colourful/cake
*/
@kirjavascript
kirjavascript / README.md
Last active December 15, 2015 01:30
Incorrectly Animated Tree
@kirjavascript
kirjavascript / README.md
Last active December 15, 2015 01:38
"Correctly" Animated Tree

This is my solution (hack) for fixing the incorrectly animated tree.

The issue occurs because animations are interrupted when new data comes from an API at this speed. I know I can queue the data instead but I would prefer to try without doing that (it doesn't look as stuttery).

When loading a new path, d3 seems to give you the position the source node will be upon finishing the animation instead of a transitional value.

My fix for this is to assign the id of each node as an attribute so that when a path needs to load mid animation it can directly pull the position from the node instead of the data position used by d3. This feels ugly.

Does anyone have a better fix?

@kirjavascript
kirjavascript / index.html
Last active February 23, 2016 20:59
sonicgolf
<body></body>
<script>
w="+2786568;<=>979;999323446772,***/02479";j=s=y=t=[];for(k=[];t<293;)f=atob("AAAAAAAAEQAgIhIRESIAECEiIgIgIxERACIiIjQjgREBIgJCMwOIGAECAEIUgYiIEQAAAgARGBGBEQAAIAKBGBGZGBgBAAAgAqgYkaqJEYEAIgIiEIgRqqoHESciIiIiAhERqqp3ECciIgAAoap6h3ciIgAAqKp3egsgIgKkiqqqtLcAACIiNDOqqjN3BwAiIiI0MzMzMyAiIiIiNDMzRAYiIiIiJ0JERGYiInInAmYmMjMDNEMmM0QENDNDMkQiAjQzQzIkIgJEM2QipJqaAERktyKmqaoCACCbCQC5mSkgJ7eZkpkZIHK3mRIiEiISIhIim6q6mbm7mbubeZZpprabdmaWult3m3lmtllVVXV3ZmdmW1VVVVV1Z3Z3d3d3d3d3d3c")[o='charCodeAt'](t++),k.push(f&15,f>>4);q=".+*2(6<'*6;(-6.5-6+8);(<'=&>+9-7,9*;)9)9(9-3/2.3-4-4,6,7,7,'0,7+1*7(3(7(2(7(2(7(0+6*0+6+/2/4.7.9.9";(p=document.body.style).width=c="10px";for(p.height=c;j<98;)for(a=q[o](j++)-(e=38),b=q[o](j++)-e,i=0;i<b;)y.push((i+++a)*10);for(i=v=[];i<e;)v.push(w[o](i++)-e);for(i=1;i<e;)v[i]+=v[i++-1];for(i=u=0;i<586;)-1<v.indexOf(i)?u+=10:s,s[i]=y[i]+"px "+u+"px#"+"24C44E22AEA8A64E0080000066EAAAFFF888".match(/.../g)[k[i++]];p.boxShadow=s
</script>
@kirjavascript
kirjavascript / index.html
Created December 12, 2015 03:35
AdventOfCode Day9
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head><title>9</title></head>
<body><p>Faerun to Norrath = 129
Faerun to Tristram = 58
Faerun to AlphaCentauri = 13
Faerun to Arbre = 24
Faerun to Snowdin = 60
Faerun to Tambi = 71
@kirjavascript
kirjavascript / index.html
Last active October 24, 2016 20:56
Sonic Disassembly Opcode Frequency
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head><title>sonic.asm</title></head>
<body>
<div class="input">
<input type="button" value="Sonic 1" onclick="update(s1, 'Sonic 1')" />
<input type="button" value="Sonic 2" onclick="update(s2, 'Sonic 2')" />
<input type="button" value="Sonic 3&amp;K" onclick="update(s3, 'Sonic 3&amp;K')" />
</div>