Skip to content

Instantly share code, notes, and snippets.

@schuetz
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save schuetz/dc4f58ad587a8d788ae2 to your computer and use it in GitHub Desktop.

Select an option

Save schuetz/dc4f58ad587a8d788ae2 to your computer and use it in GitHub Desktop.

Revisions

  1. schuetz revised this gist Aug 13, 2015. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions jquery.contains_ci.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    // make jQuery :contains-Selector case-insensitive
    $.expr[':'].contains = $.expr.createPseudo(function(arg) {
    return function(elem) {
    return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
    };
    });
  2. schuetz revised this gist Aug 13, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions touchsupport.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    var touchsupport = ('ontouchstart' in window || navigator.msMaxTouchPoints) ? true : false;
  3. schuetz renamed this gist Aug 13, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. schuetz revised this gist Aug 13, 2015. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions debounced_resize.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    // debulked onresize handler
    function on_resize(c,t){onresize=function(){clearTimeout(t);t=setTimeout(c,100)};return c};

    on_resize(function() {
    // handle the resize event here
    });
  5. schuetz created this gist Jun 12, 2015.
    2 changes: 2 additions & 0 deletions misc.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    // Avoid `console` errors in browsers that lack a console.
    (function(){var method;var noop=function(){};var methods=['assert','clear','count','debug','dir','dirxml','error','exception','group','groupCollapsed','groupEnd','info','log','markTimeline','profile','profileEnd','table','time','timeEnd','timeStamp','trace','warn'];var length=methods.length;var console=(window.console=window.console||{});while(length--){method=methods[length];if(!console[method]){console[method]=noop;}}}());