JSFiddle

  • Simple guessing game

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

    <div class='blocks'>    
        <div class='statement'>
            <p class='text'>Store a secret number, from 1 to 50, in your brain's memory.</p>
            <code class='code'>var secret = 34</code>        
        </div>
    
        <div class='statement'>
            <p class='text'>Ask opponent, "What is ...</p></div></div>
  • Simple guessing game #1 is the latest revision

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

    // Hard coded approach:
    
    /*
    34
    30
    
    if (30 < 34) alert("Guess higher!")
    
    if (44 > 34) alert("Guess lower!")
    
    if (34 === 34) alert("You got it! Game over ...
  • VersionOne API query with AngularJS #5 is the latest revision

    AngularJS 1.0.3, HTML, CSS, JavaScript

    function DemoController($scope) {
        var members = [];
        
        var hostname = "ec2-54-205-135-234.compute-1.amazonaws.com";
        var instance = "VersionOne";
        var username = "admin";
        var password = "admin ...
  • Cookies Time with Mongo + Backbone

    jQuery 1.7.2, HTML, CSS, CoffeeScript, Bootstrap 2.0.2 (js only)

    makeUrl = (fragment) ->
        return "https://api.mongolab.com/api/1/databases/tastily/collections/recipes/" + fragment + "?apiKey=bWK-cL1WKkJF6yyunAhSjhszvkkTTOlM"
    
    makeUrlWithQuery = (fragment, query) ->
        return ...
  • Cookies Time with Mongo #4 is the latest revision

    jQuery 1.7.2, HTML, CSS, CoffeeScript, Bootstrap 2.0.2 (js only)

    Recipe = {}
    form = {}
    
    $ ->
        Backbone.Form.editors.List.Modal.ModalAdapter = Backbone.BootstrapModal
    
        $('#new').click -> newRecipe()
        $('#save').click -> saveRecipe()
            
        rVals = ['required']
        
        Recipe = Backbone ...
  • Cookies Time

    jQuery 1.7.2, HTML, CSS, CoffeeScript, Bootstrap 2.0.2 (js only)

    $ ->
        Backbone.Form.editors.List.Modal.ModalAdapter = Backbone.BootstrapModal
    
        rVals = ['required']
        
        Recipe = Backbone.Model.extend(schema:
            name: 
                type: 'Text'
                title: 'Recipe ...
  • Bootstrap form example

    jQuery 1.7.2, HTML, CSS, CoffeeScript, Bootstrap 2.0.2 (js only)

    oldBbm = Backbone.BootstrapModal
    Backbone.BootstrapModal = ->
      sc = arguments[0].content.options.schema
      title = "Add Item"
      for item of sc
        if sc ...
  • Calculator 002

    jQuery 1.9.1, HTML, CSS, JavaScript

    <html>
    <head>
        <title>Calculator - File Based Extensibility</title>        
        <script src="https://gist.github.com/JogoShugh/5275545/raw/747581724f7306851e221f9f5b8792f09073710d/calcultor.js" language="javascript"></script>
        <script src="https://gist.github.com/JogoShugh/5275545/raw/4b928cb9031deb4036ea590e02e795ac3f4b569b/add.js" language="javascript"></script>
        <script src="https://gist.github.com/JogoShugh/5275545/raw/1a4a0f23da0c60f2b5359078d6bbd9254e629436/subtract.js" language="javascript"></script>
        <script language="javascript">
            $(function() {
                var calc = new Calculator();
                var output = $("#output");
                output.append(calc.add(1,2,3) + "<br/>");
                output ...</br/></script></head></html>
  • Calculator 002

    jQuery 1.9.1, HTML, CSS, JavaScript

    function Calculator() {
    }
    
    Calculator.prototype.add = function () {
        var result = 0;
        for (var i = 0, j = arguments.length; i < j; i++) {
            result += parseFloat(arguments[i]);
        }
        return result;
    };
    
    Calculator.prototype.subtract = function () {
        var result = 0;
        if (arguments.length > 0) result = arguments ...
  • Calculator 001

    jQuery 1.9.1, HTML, CSS, JavaScript

    function Calculator() {
        this.add = function () {
            var result = 0;
            for (var i = 0, j = arguments.length; i < j; i++) {
                result += parseFloat(arguments[i]);
            }
            return result;
        };
        this.subtract = function () {
            var result = 0;
            if (arguments.length > 0) result = arguments[0 ...