Skip to content

Instantly share code, notes, and snippets.

View caracal7's full-sized avatar

Dmitrii Vasilev caracal7

  • This planet
View GitHub Profile
@yckart
yckart / LICENSE.txt
Last active March 8, 2019 10:43 — forked from 140bytes/LICENSE.txt
debounce
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 Yannick Albert <http://yckart.com>
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
@bcrisp
bcrisp / README.md
Last active February 1, 2018 13:36
κατά: Catamorphisms in JavaScript

Catamorphisms in JavaScript

Inspired by Brian McNamara's work on catamorphisms in F#, this is a proof-of-concept implementation for a tail-recursive JavaScript function using continuation-passing style.

Due to differences in the way D3.js handles vertices and edges for force-directed graph and tree layouts, this is actually more than strictly catamophorphic: since it can take a tree to any other structure, including another tree, code editor and D3.js visualization tool for translating JavaScript to abstract syntax trees and then to a tree. This only parses a small subset of JavaScript code, but it demonstrates catamorphisms, continuation-passing style, and utilizes tail-recursion (when JavaScript supports it.)

Although this project uses several JavaScript libraries for visualization and parsing, the actual AST destruction is implemented in pure J

@jussi-kalliokoski
jussi-kalliokoski / LICENSE.txt
Last active March 8, 2018 11:44 — forked from 140bytes/LICENSE.txt
A 140byt.es UUIDv4 generator.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jussi Kalliokoski <[email protected]>
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
@Unitecho
Unitecho / gist:5582824
Created May 15, 2013 09:45
Worker Thread pool JS
http://www.smartjava.org/content/html5-easily-parallelize-jobs-using-web-workers-and-threadpool
function Pool(size) {
var _this = this;
// set some defaults
this.taskQueue = [];
this.workerQueue = [];
this.poolSize = size;
@bellbind
bellbind / astar.js
Last active February 3, 2018 14:34
[nodejs][javascript]A* with Jump Point Search
// A* with Jump Point Search on JavaScript
// - python A*: https://gist.github.com/bellbind/147645
// utility: Priority Queue
var PQ = function PQ() {
return Object.create(PQ.prototype, {
array: {value: []},
});
};
PQ.prototype.empty = function () {
@xem
xem / LICENSE.txt
Last active October 29, 2022 09:55 — forked from 140bytes/LICENSE.txt
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
@valentinkostadinov
valentinkostadinov / WorkerPool.js
Created January 15, 2013 09:29
A simple HTML5 web worker pool (think thread pool) implementation for parallel execution of computationally intensive operations. The pool will lazily grow up to its given capacity. On saturation, messages will be queued up until a worker from the pool becomes available. The interface hides the Worker listener pattern and instead provides a sing…
/**
* A web worker pool implementation for parallel execution of
* computationally intensive operations. The pool will lazily grow up to its
* given capacity. On saturation, messages will be queued up until a worker
* from the pool becomes available.
*
* var capacity = 3;
* var pool = new WorkerPool(capacity, "./worker.js");
* for (var i = 0; i < 10; i++) {
* pool.postMessage(msg, function(err, result) {
double t = 0.0;
const double dt = 0.01;
double currentTime = hires_time_in_seconds();
double accumulator = 0.0;
State previous;
State current;
while ( !quit )
@mbostock
mbostock / .block
Last active February 20, 2025 10:51
Gradient Along Stroke
license: gpl-3.0
@0xNaN
0xNaN / LICENSE.txt
Created October 22, 2012 21:00 — forked from 140bytes/LICENSE.txt
Conway's Game of Life
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