Skip to content

Instantly share code, notes, and snippets.

@michaweber
michaweber / preloadcss.html
Created March 3, 2018 14:40
load css asynchronously
<link rel="preload" href="./css/main.css" as="style" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="./css/main.css"></noscript>
<script>/*!loadCSS. [c]2017 Filament Group, Inc. MIT License*/(function(w){"use strict";if(!w.loadCSS){w.loadCSS=function(){};} var rp=loadCSS.relpreload={};rp.support=(function(){var ret;try{ret=w.document.createElement("link").relList.supports("preload");}catch(e){ret=false;} return function(){return ret;};})();rp.bindMediaToggle=function(link){var finalMedia=link.media||"all";function enableStylesheet(){link.media=finalMedia;} if(link.addEventListener){link.addEventListener("load",enableStylesheet);}else if(link.attachEvent){link.attachEvent("onload",enableStylesheet);} setTimeout(function(){link.rel="stylesheet";link.media="only x";});setTimeout(enableStylesheet,3000);};rp.poly=function(){if(rp.support()){return;} var links=w.document.getElementsByTagName("link");for(var i=0;i<links.length;i++){var link=links[i];if(link.rel==="preload"&&link.getAttri
for i in {0..255} ; do printf "\x1b[38;5;${i}mcolour${i}\n" ; done | column
@michaweber
michaweber / mvn_install_ojdbc.md
Last active April 25, 2016 12:47
install oracle jdbc
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 \
  -Dversion=11.1.0.6.0 -Dpackaging=jar -Dfile=lib\ojdbc6.jar -DgeneratePom=true
awk -F "\t" '{print $3" "$1"\n\tAssets:Checking\t\t\t€"$6"\n\tExpenses:"$1}'
for i in `find . -type f|grep "IMGP"`;do mdls -name kMDItemFocalLength $i >> ~/Desktop/apertures.txt;done;
@michaweber
michaweber / README.markdown
Created July 17, 2012 08:25 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string