JSFiddle

  • FizzBuzz

    interview test

    var container = document.getElementById('container'),
        html_str = '';
    
    for (var i = 1; i <= 100; i++) {
        html_str += '<div>';
        if ((i % 3 == 0) && (i % 5 == 0)) {
            html_str += 'fizzbuzz';
        } else if (i % 3 == 0 ...</=>
  • Instagram API Tag Search #453 is the latest revision

    GET /tags/tag-name/media/recent via JS

    var access_token = "16384709.6ac06b4.49b97800d7fd4ac799a2c889f50f2587",
        access_parameters = {
            access_token: access_token
        };
    
    var form = $('#tagsearch');
    form.on('submit', function(ev) {
        var q = this.tag ...
  • Dailymile API – Last run

    Number of days since my last (synced on DM) run, sigh…

    function callback(data) {
        for(var i=0; i<data.entries.length; i++) {
            var el = data.entries[i];
            if (el.workout ...
  • Plain JS Drag&Drop

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

    var isdrag = false;
    var x, y;
    var dobj;
    
    function movemouse(e) {
        if (isdrag) {
            console.log(dobj, tx, x);
            dobj.style ...
  • Rotating CSS Anim #40 is the latest revision

    Early playing around w/ CSS3 & keyframe animation

    <div id="anim" class="animated">
        <div id="rays"></div>
        <div id="smiley"></div>
    </div>
    
  • Sprite-based CSS Keyframe Animation

    + steps() function

    <div id="bird" class="animated"></div>
    <div id="sprite">
        <img src="http://www.spritely.net/images/bird-forward-back.png" />
    </div>
  • Basic jQuery Lightbox #43 is the latest revision

    jQuery 1.5.2, HTML, CSS, JavaScript

    $("a.lightbox").click(function(e) {
        $("body").css("overflow-y", "hidden");
        $('<div id="lightbox_overlay"></div>')
            .css("top", $(document).scrollTop())
            .css("opacity", 0)
            .animate({ opacity: 0.5 ...
  • CSS3 Speech bubble #14 is the latest revision

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

    <p class="speech">Yay! (<a href="http://blogs.sitepoint.com/pure-css3-speech-bubbles/">link</a>)</p>
    
    
  • Countdown from 100? #166 is the latest revision

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

    window.onload = function() {
    
        var log = document.getElementById("log");
        var btn = document.getElementById("btn");
        var counting = false;
    
        function start(count) {
            //console ...
  • Prime number check #21 is the latest revision

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

    function isPrime(num) {
        var prime = num != 1;
        for(var i=2; i<num; i++) {
            if(num % i == 0) {
                prime = false ...