See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.
Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)
Heads Up! It's all about the V1 Spec.
In a nutshell, Shadow DOM enables local scoping for HTML & CSS.
// Simulate a call to Dropbox or other service that can | |
// return an image as an ArrayBuffer. | |
var xhr = new XMLHttpRequest(); | |
// Use JSFiddle logo as a sample image to avoid complicating | |
// this example with cross-domain issues. | |
xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true ); | |
// Ask for the result as an ArrayBuffer. | |
xhr.responseType = "arraybuffer"; |
// Load plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), | |
jshint = require('gulp-jshint'), | |
uglify = require('gulp-uglify'), | |
imagemin = require('gulp-imagemin'), | |
rename = require('gulp-rename'), | |
clean = require('gulp-clean'), |
const { data } = await axios.get(url, { | |
responseType: 'arraybuffer', | |
headers: { | |
'Content-Type': 'audio/wav' | |
} | |
}); | |
const blob = new Blob([data], { | |
type: 'audio/wav' | |
}); |
// note - this was my rough working prototype, but still left some artifacts in the query params. | |
// todo: also need to debounce the history pushes | |
// see comments for production Gatsby and Svelte versions which delete nondefault keys in the query params | |
import React from 'react' | |
import queryString from "query-string" | |
export const connectRouterState = defaultURLState => Component => props => { | |
const { history, location } = props | |
// note: do not nest objects in URL state |
'use strict'; | |
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var del = require('del'); | |
var uglify = require('gulp-uglify'); | |
var gulpif = require('gulp-if'); | |
var exec = require('child_process').exec; | |
var notify = require('gulp-notify'); |
Expands on Handling required parameters in ECMAScript 6 by Axel Rauschmayer.
The idea (which is credited to Allen Wirfs-Brock) is, in essence, to use default parameter values to call a function which throws an Error if the parameter is missing:
const throwIfMissing () => { throw new Error('Missing parameter') }