JSFiddle

  • Python Arrays

    No-Library (pure JS), HTML, CSS, JavaScript

    class PythonArray {
        constructor() {
            return new Proxy([], {
                get: function(target, name) {
                    var index = parseInt(name, 10);
    
                    if (name === NaN) {
                        if (name ...
  • Infix to Postfix

    No-Library (pure JS), HTML, CSS, JavaScript

    log(infixToPostfix(tokenize("1 + 2")));
    log(infixToPostfix(tokenize("1 + 2 * 3")));
    log(infixToPostfix(tokenize("1 * (2 + 3 * 4) + 5")));
    
    // Algorithm ...
  • jasmine test running on jsFiddle

    jsFiddle template to run a jasmine test inside jsFiddle. Adds jasmine external resources, and initializes jasmine's HtmlReporter on window load. For more infor check this article: http://opensas.wordpress.com/2013/06/23/sharing-you-javascript-ninja-secrets-run-your-jasmine-tests-on-jsfiddle/

    describe("The system", function() {
    
        it("should fail", function() {
            expect(true).toBe(false);
        });
    
        it("should succeed", function(done) {
            setTimeout(function() {
                expect ...
  • Remove emoji skin tone updated

    No-Library (pure JS), HTML, CSS, Babel + JSX

    function removeSkinTone(string){
    	// This will also work
    	var modifier = new RegExp("\ud83c[\udffb-\udfff]", "g");
        // Remove skin tone modifier
    	return ...
  • Removing modifiers in emojis

    No-Library (pure JS), HTML, CSS, JavaScript

    var UnicodeString;
    function main(){
    	// Modifiers
        var modifiersMin = 0x1F3FB, modifiersMax = 0x1F3FF;
    
    	// Emoji with U+1F3FB "light skin tone" modifier
        var string ...
  • Better Promise.all

    No-Library (pure JS), HTML, CSS, Babel + JSX

    // Fake task
    function genVal(val){
    	var randomInt = Math.random() * 2000 | 0;
    	return new Promise(res => setTimeout(() => {
        	console.log(`Value ${val ...
  • Archiving images with JavaScript

    No-Library (pure JS), HTML, CSS, JavaScript

    function prepareZip(images){
    	var zip = new JSZip();
        images.forEach((image, i) => zip.file(`seq${i}.gif`, image, {base64: true}));
        return ...
  • GSP #2 is the latest revision

    No-Library (pure JS), HTML, CSS, Babel + JSX

    class Itemset{
    	constructor(items){
        	this.items = new Set(items);
        }
        equals(itemset){
        	if(itemset.size !== this.size)	return false;
            for(let ...
  • Decision Tree

    No-Library (pure JS), HTML, CSS, Babel + JSX

    class Node{
    	constructor(attribute_values, entries){
        	this.attribute_values = attribute_values;
            this.labels = [...new Set(entries.map(entry => entry.label))];
        	this.entries = entries ...
  • Search Algorithms

    A*, DFS, Beam Search, Hill Climbing

    var nodes = {
    	A: {
        	h: 3,
            g: 0,
            children: [
            	{id: "B", v: 2},
                {id: "C", v: 1},
                {id: "D", v: 4 ...