JSFiddle

  • 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 ...
  • 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 ...
  • Simple Image Blurring

    Image blur using simple average of neighboring pixels.

    var input = document.getElementById("imageInput"),
    	imageDataUrl = null;
        
    function Stage(canvas, status){
    	this.canvas = canvas;
        this.ctx = canvas.getContext("2d");
        this ...
  • Schedulability Exact Analysis

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

    var tasks = [
    	{c: 0, p: 64, b: 0, d: 64},
    	{c: 12, p: 65, b: 7, d: 55},
        {c: 25 ...
  • Slanted folds

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

    <div class="list">
        <div class="slanted">
            <div class="slanted-content">First</div>
        </div>
        <div class="slanted">
            <div class="slanted-content">Second</div>
        </div>
        <div class="slanted">
            <div class="slanted-content">Third</div>
        </div>
    </div>