Skip to content

Instantly share code, notes, and snippets.

@idibidiart
idibidiart / README.md
Created February 18, 2016 00:16 — forked from fabiovalse/README.md
Non-overlapping regions through collision detection
@idibidiart
idibidiart / README.md
Created February 19, 2016 03:57 — forked from veltman/README.md
Gif rendering - SVG to GIF

Testing in-browser gif generation from an SVG with gif.js. Works in recent Chrome/Safari/Firefox.

Process:

  1. Create a standard SVG line chart.
  2. Step through in-between frames of the line chart: for each one, update the SVG, render to an image, add the image element to a stack of gif frames.
  3. Render frames together in the background using gif.js web workers.
  4. When rendering's complete, add the blob URL as an image and start the SVG on an infinite loop with d3.timer (gratuitous).

See also: Gif Globe, Gif New Jersey

@idibidiart
idibidiart / graphql-relay-miracle-cure.md
Last active February 21, 2016 22:06
UI Blues Got You Down? Try GraphQL/Relay Miracle Cure! :D
function rawAsap(task) {
if (!queue.length) {
requestFlush();
flushing = true;
}
// Equivalent to push, but avoids a function call.
queue[queue.length] = task;
}
var queue = [];
@idibidiart
idibidiart / readme.md
Created August 1, 2016 04:19 — forked from vizath/readme.md
SlimerJS on AWS EC2 with webgl support

There is not a lot of doc or posts about making an headless renderer with webgl support. Here are few of my findings

I tried things on Heroku, but I was not able to make anything work.

Next, I tried EC2 t2.micro, only to find out that OpenGL needs a graphic card to execute (sure, there are things like mesa that I didn't tried, but it looked like I needed to build Chrome and I didn't want to go that way).

The only easy solution that I found was AWS EC2 GPU Instances. They are pretty much overpriced for what I'm trying to acheive, but it worked. You need to use an AMI that support the Nvidia GRID thing. eg https://aws.amazon.com/marketplace/pp/B00FYCDDTE and its CentOS.

Slimer need Firefox and Firefox need shared libraries that we need to install (we will use a custom repo).

@idibidiart
idibidiart / clipboard-example.html
Created February 22, 2017 17:49 — forked from scottoffen/clipboard-example.html
JavaScript Copy To Clipboard Example
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Copy To Clipboard Example</title>
</head>
<body>
<input id="txtToCopy" type="text">
<button id="btnCopy">Copy!</button>
@idibidiart
idibidiart / testing.md
Created September 14, 2017 13:20
Last night's testing
  1. Unhandled Promise Rejections

Cause silent failure mode, with unlogged warning, on older version of Node Cause a crash on newer version of Node

I had already told some developers about it. Prakash avoided it in Power Reviews

In FromManufacturer.js

componentDidMount() {

@idibidiart
idibidiart / test.md
Last active September 22, 2017 05:10
@idibidiart
idibidiart / Infrastructure.js
Last active September 10, 2020 00:53 — forked from sebmarkbage/Infrastructure.js
SynchronousAsync.js
const fetch = (url) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log(url)
switch(url.match(/\d[aA-zZ]$/)[0]) {
case "1a":
resolve({name: "Seb"})
// or try this instead:
// reject({error: "something went wrong while fetching " + url})
break;
@idibidiart
idibidiart / Readme.md
Created March 19, 2018 16:18 — forked from vicapow/Readme.md
WebGL + d3.layout.force

This demo uses d3.layout.force() to calculate the node positions and then passes those to webGL to render them on the GPU.