JSFiddle

  • String To Date

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

    function stringToDate(dateAsString, format, delimiter) {
      var formatLowerCase = format.toLowerCase();
      var formatItems = formatLowerCase.split(delimiter);
    
      var dateItems = dateAsString.split(delimiter);
    
      var ...
  • SVG - Run Icon #2 is the latest revision

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

    <!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Clipping_and_masking -->
    <img src="http://i.imgur.com/qsfnk0a.png" alt="">
    
    <svg version="1.1" 
        xmlns="http://www.w3.org/2000/svg"
        xmlns:xlink="http://www.w3.org/1999/xlink"
        width="200" height="200">
        <defs>
        <style type="text/css"><![CDATA[
           svg line,
           svg polyline {
              stroke: black;
              fill: none;
              stroke-width: 15;
              stroke-linecap: round;
              stroke-linejoin: round;
            }
        ]]></style>
      </defs>
      
      <line x1="109" y1="45" x2="100" y2="108" id="torso" />
      
      <polyline points="109 45 71 60 76 91" id="right-arm"/>
      <polyline points="109 45 150 38 141 70" id="left-arm"/>
      <polyline points="100 108 79 152 45 168" id="right-leg"/>
      <polyline points="100 108 141 146 138 178" id="left-leg"/>
    
      <circle cx="115" cy="19" r="15" fill="black" id="face" />
      <circle cx="144" cy="58" r="8" fill="red" id="watch" />
            
    </svg>
    
  • Boxing an Array

    jQuery (edge), HTML, CSS, JavaScript, Firebug Lite

    var arrayOfStrings = [
      "https://jsfiddle.net/",
      "https://www.google.com/",
      "http://stackoverflow.com/"
    ];
    var arrayToJSON = JSON.stringify(arrayOfStrings)
    var JSONToArray = JSON ...
  • Garmin Color Palette

    jQuery 2.2.4, HTML, CSS, JavaScript

    var colors16 = [
      {r: 255, g: 255, b: 255, hex: '#FFFFFF', name: 'WHITE'},
      {r: 170, g: 170, b: 170, hex: '#AAAAAA ...
  • DataTables.js Add/Replace Row #8 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript

    $(function() {
    	  // initialize table
        var $dt = $('#example').DataTable({
            paging:   false,
            bFilter: false, 
            bInfo: false
        });
        
     		// add row
        $('#addRow').click(function () {
            //$dt.row ...
  • Debug Breakpoint Interrupts Event

    jQuery 2.2.4, HTML, CSS, JavaScript

    $("#NameA").blur(function(e){
    	console.log(this.id + ' ' + e.type + 'ed');
    });
    $("#SubmitA").click(function(e){
    	console.log(this.id + ' ' + e ...
  • jQuery Validation Unobtrusive #5 is the latest revision

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

    $("#Name").on('change blur',function(e){
    debugger;
    	console.log(this.name + ' ' + e.type + 'ed');
      $("#myForm").data('validator').element('#Name');
    });
    
    $("input ...
  • Deep Clone Array

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

    var originalArray = [
    	{name: 'Ted', age: 32},
      {name: 'Bob', age: 54}
    ]
    
    var clonedArray = JSON.parse(JSON.stringify(originalArray))
    
    console.log(originalArray ...
  • String to Date #3 is the latest revision

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

    var a = new Date(2011,11,30);
    var b = Date.parse('11/30/2011');
    
    console.log(typeof a) // object (date ...
  • Stack Fixed Bottom #11 is the latest revision

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

    <div class="bottom-ish">Bottom-Ish</div>
    <div class="bottom-est">Bottom-Est</div>