Skip to content

Instantly share code, notes, and snippets.

window.fetch = (url, info) => {
return new Promise(function (resolve, reject) {
let xhr = new XMLHttpRequest();
xhr.open(info.method || "GET", url);
if (url.endsWith(".wasm"))
xhr.responseType = "arraybuffer";
xhr.onload = function () {
if (this.status >= 200 && this.status < 300) {
resolve({
@sabitertan
sabitertan / Ipsum.js
Created March 18, 2019 16:17
very long happy ipsum
import React, { Component } from 'react';
class Ipsum extends Component{
render(){
return(
<div id="generatedText" className="generated-text plain-text">If it's not what you want - stop and change it. Don't just keep going and expect it will get better. You don't want to kill all your dark areas they are very important. Nice little fluffy clouds laying around in the sky being lazy.
Working it up and down, back and forth. Maybe there's a happy little bush that lives right there. Now let's put some happy little clouds in here. You can do anything here. So don't worry about it. We're not trying to teach you a thing to copy. We're just here to teach you a technique, then let you loose into the world. I started painting as a hobby when I was little. I didn't know I had any talent. I believe talent is just a pursued interest. Anybody can do what I do.
You can't make a mistake. Anything that happens you can learn to use - and make something beautiful out of it. Put your feelings into it, yo
@sabitertan
sabitertan / onetinyanimate.js
Created August 3, 2016 16:21
TinyAnimate simplified with one animation (easing.linear)
var TinyAnimate = {};
TinyAnimate.animate = function(from, to, duration, update, done) {
// Early bail out if called incorrectly
if (typeof from !== 'number' ||
typeof to !== 'number' ||
typeof duration !== 'number' ||
typeof update !== 'function')
return;
// easing.linear look https://github.com/branneman/TinyAnimate/blob/master/src/TinyAnimate.js for others