Table of content:
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
gen = (cur, all, chunk = 10) -> | |
half = (chunk - 4) // 2 | |
ledge = Math.max(1 , cur - half) | |
redge = Math.min(all, cur + half) | |
ldiff = half - (cur - ledge) + ((ledge < half-1) && 2 || (ledge < half) && 1 || 0) | |
rdiff = half - (redge - cur) + ((cur+half >= all) && 2 || (cur+half+1 == all) && 1 || 0) | |
prev = 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
;(function() { | |
"use strict"; | |
/** | |
* @typedef {Object} MouseEventOptions | |
* @property {Boolean} canBubble - Whether or not the event can bubble. | |
* @property {Boolean} cancelable - Whether or not the event's default action can be prevented. | |
* | |
* @property {AbstractView} view - The event's AbstractView. You should pass the window object here. | |
* @property {Number} detail - The event's mouse click count. |
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
class SimpleMutationObserver { | |
constructor(node) { | |
this.node = node; | |
this.selectors = {}; | |
this.handlers = {}; | |
this.observer = new MutationObserver(() => { | |
for (var selector in this.selectors) { | |
var oldState = this.isEnabled(selector); | |
var newState = this.checkEnabled(selector); |
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
fs = require 'fs' | |
# Structure of cache file: | |
# | |
# { | |
# "path/to/output/file/1": { | |
# "cache": { | |
# "path/to/source/file/1": { | |
# "size" : <file size>, | |
# "mtime": <file modified time in ms>, |
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
(($) -> | |
$window = $(window) | |
now = -> (new Date).getTime() | |
sign = Math.sign ? (v) -> if v > 0 then 1 else (if v < 0 then -1 else 0) | |
instances = 0 | |
fps = 16 | |
# RAF Polyfill | |
requestAnimationFrame = window.requestAnimationFrame | |
cancelAnimationFrame = window.cancelAnimationFrame |
https://github.com/nickdesaulniers/bf_interpreter_jit_compiler
$ gcc -std=c99 interpreter.c file_io.c -o bf
$ time ./bf ../fractal.bf
...
real 2m7.077s
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
class InverseAlphaFilter extends createjs.Filter | |
constructor: -> | |
toString: -> | |
return "[InverseAlphaFilter]" | |
clone: -> | |
new InverseAlphaFilter |
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
notebook > header { | |
background: #f5f6f7; | |
border: none; | |
} | |
notebook > header > tabs { | |
background: transparent; | |
} | |
notebook > header > tabs > tab { | |
background: transparent; | |
color: #8e9195; |
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
@PropertyMixin = | |
property: (prop, options) -> | |
Object.defineProperty @prototype, prop, options | |
reactiveProperty: (name) -> | |
@property name, | |
get: -> | |
dep = @["_#{name}_dep"] ?= new Tracker.Dependency | |
dep.depend() |