JSFiddle

  • My daily routine timeline

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

          google.charts.load('current', {
            'packages': ['timeline']
          });
          google.charts.setOnLoadCallback(drawChart);
    
          function drawChart() {
            var container = document.getElementById('timeline');
            var chart = new ...
  • Add line number to PRE CODE block

    For use in Jekyll theme design

    (function() {
        var pre = document.getElementsByTagName('pre'),
            pl = pre.length;
        for (var i = 0; i < pl; i++) {
            pre[i].innerHTML = '<span class="line-number"></span>' + pre[i].innerHTML + '<span class="cl"></span>';
            var num = pre ...
  • Pretty clean MySQL syntax highlighter

    Creating pretty clean and minimalist syntax highlighting for MySQL using standard jQuery and CSS.

    $(document).ready(function(){
    	//full list of reserved words: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
    	var ...
  • Get line number of caret

    Javascript function to get line number of caret

    function getLineOfCaret(el) {
        var pos = 0;
        if (el.selectionEnd) {
            pos = el.selectionEnd;
        } else if (document.selection) {
            el.focus();
    
            var r ...