This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const assert = require('assert'); | |
| const objectAssign = require('object-assign'); | |
| const minimatch = require('minimatch'); | |
| const path = require('path'); | |
| const preloadDirective = { | |
| '.js': 'script', | |
| '.css': 'style', | |
| '.woff': 'font', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Usage: IE={box} vagrant up | |
| # | |
| # Eg. IE=XPIE6 vagrant up | |
| # | |
| # Password: Passw0rd! | |
| boxes = { | |
| "XPIE6" => "http://aka.ms/ie6.xp.vagrant", | |
| "XPIE8" => "http://aka.ms/ie8.xp.vagrant", | |
| "VistaIE7" => "http://aka.ms/ie7.vista.vagrant", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // from https://stackoverflow.com/questions/10742422/prevent-browser-scroll-on-html5-history-popstate | |
| if ('scrollRestoration' in history) { | |
| history.scrollRestoration = 'manual'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| ) | |
| func rootHandler(w http.ResponseWriter, r *http.Request) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ctrl+K plus: | |
| ! Grave | |
| ' Acute accent | |
| > Circumflex accent | |
| ? Tilde | |
| - Macron | |
| ( Breve | |
| . Dot above | |
| : Diaeresis | |
| , Cedilla |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| declare -i ID | |
| ID=`xinput list | grep -v 'Synaptics' | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'` | |
| declare -i STATE | |
| STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'` | |
| if [ $STATE -eq 1 ] | |
| then | |
| xinput disable $ID | |
| #echo "Touchpad disabled." | |
| #notify-send 'Touchpad' 'Disabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export defaul function xt(tmpl, p = document.createDocumentFragment()) { | |
| if (!tmpl.length) { | |
| return p; | |
| } | |
| const t = tmpl.slice(); | |
| const o = t.shift(); | |
| if (o instanceof Array) { | |
| p.appendChild(xt(o, document.createElement(o.shift()))); |
Let's close the ultra-small library cycle with some awesome array-based templating. 323 bytes minified.
Just download the minified version here or include it into your code:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Source: http://jamesknelson.com/should-i-use-react-createclass-es6-classes-or-stateless-functional-components/ | |
| - constructor: Initialization of state. The instance is now retained. | |
| - componentWillMount | |
| - render | |
| - [children's constructors] | |
| - [children's componentWillMount and render] | |
| - [children's componentDidMount] | |
| - componentDidMount |