Skip to content

Instantly share code, notes, and snippets.

View ninetails's full-sized avatar
🏳️‍⚧️
traaa

Nina Kitsu ninetails

🏳️‍⚧️
traaa
View GitHub Profile
@ninetails
ninetails / index.js
Last active March 28, 2018 12:27
resource-hint-webpack-plugin
'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',
@ninetails
ninetails / Vagrantfile
Created February 27, 2018 10:30 — forked from anthonysterling/Vagrantfile
Handy Vagrantfile for IE testing with Vagrant.
# 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",
@ninetails
ninetails / stopScroll.js
Created November 23, 2017 01:26
Stop scroll on popstate
// from https://stackoverflow.com/questions/10742422/prevent-browser-scroll-on-html5-history-popstate
if ('scrollRestoration' in history) {
history.scrollRestoration = 'manual';
}
@ninetails
ninetails / app.go
Created March 2, 2017 22:37 — forked from superbrothers/app.go
Simple Web Server with golang
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func rootHandler(w http.ResponseWriter, r *http.Request) {
ctrl+K plus:
! Grave
' Acute accent
> Circumflex accent
? Tilde
- Macron
( Breve
. Dot above
: Diaeresis
, Cedilla
@ninetails
ninetails / touchpad.sh
Last active December 15, 2016 18:16
Disable touchpad on Dell Inspiron 15 5000 (P55F)
#!/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
@ninetails
ninetails / usage.js
Created October 31, 2016 19:45
ES6 XT.js
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())));
@ninetails
ninetails / README.md
Created October 31, 2016 18:50 — forked from plugnburn/README.md
XT.js - DOM construction / templating library in 18 lines of JS, 323 bytes minified

XT.js

Let's close the ultra-small library cycle with some awesome array-based templating. 323 bytes minified.

How to obtain

Just download the minified version here or include it into your code:

@ninetails
ninetails / ReactLifecycle.txt
Created May 2, 2016 21:16
The Life-Cycle of a Composite Component
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