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
html { | |
box-sizing: border-box; | |
} | |
*, *:before, *:after { | |
box-sizing: inherit; | |
} | |
html:before { | |
padding: 200px; | |
position: fixed; | |
background-color: #222; |
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
// Found in a Lea Verou project and tweaked :) (https://github.com/LeaVerou/animatable/blob/gh-pages/index.js#L1) | |
function $(expr, con) { return (con || document).querySelector(expr); } | |
function $$(expr, con) { return Array.from((con || document).querySelectorAll(expr)); } |
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
const fs = require('fs'); | |
const fetch = require('node-fetch'); | |
const FormData = require('form-data'); | |
const filePath = `path/to/file.ext`; | |
const form = new FormData(); | |
const stats = fs.statSync(filePath); | |
const fileSizeInBytes = stats.size; | |
const fileStream = fs.createReadStream(filePath); | |
form.append('field-name', fileStream, { knownLength: fileSizeInBytes }); |
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 a default import as default | |
export { default } from '../node_modules/roadtrip/dist/roadtrip.es.js'; | |
// Export a default import as named | |
export { default as router } from '../node_modules/roadtrip/dist/roadtrip.es.js'; |
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
function fetchJSON(url, options, retries = 0) { | |
return fetch(url, { cache: 'no-store', ...options }) | |
.then(res => { | |
if (res.ok) return res.json(); | |
if (retries > 0) return fetchJSON(url, options, --retries); | |
throw res; | |
}); | |
} |
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
window.addEventListener('error', e=>{if (e.target.tagName !== 'IMG') return; e.target.style.visibility = 'hidden';}, true) |
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
(function() { | |
'use strict'; | |
angular | |
.module('theApp') | |
.config(config); | |
config.$inject = ['$stateProvider', '$locationProvider', '$urlRouterProvider']; | |
function config($stateProvider, $locationProvider, $urlRouterProvider) { |
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
# where xyz is a branch name fragment, e.g. 525 (using a ticket number) | |
git checkout `git branch | grep xyz` |
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
function fetchJson(url, options) { | |
return fetch(url, { cache: 'no-store', ...options }) | |
.then(res => { if (res.ok) return res; throw res; }) | |
.then(res => res.json()); | |
} |
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
shasum -a 256 -c <<< 'd42fc3297cff5ffae69b4dd4df628d50b520b26f24d7e7671c0a6b6f30d66b28 *tidy-5.6.0-macos.dmg' | |
tidy-5.6.0-macos.dmg: OK |