Pure JavaScript Zoom and Pan, taken from http://phrogz.net/tmp/canvas_zoom_to_cursor.html
A Pen by TechSlides on CodePen.
function remove (arr, item) { | |
if (arr.length) { | |
let index = arr.indexOf(item); | |
if (index > -1) { | |
return arr.splice(index, 1) | |
} | |
} | |
} | |
function pruneCacheEntry (cache, key, keys, current) { |
import { useState } from 'react'; | |
// Usage | |
function App() { | |
// Similar to useState but first arg is key to the value in local storage. | |
const [name, setName] = useLocalStorage('name', 'Bob'); | |
return ( | |
<div> | |
<input |
[Unit] | |
Description=headless chrome | |
[Service] | |
Type=simple | |
ProtectSystem=strict | |
DynamicUser=true | |
Environment=HOME=/tmp | |
ExecStart=/usr/bin/google-chrome --headless --disable-gpu --remote-debugging-port=9222 |
function isPromise(object){ | |
if(Promise && Promise.resolve){ | |
return Promise.resolve(object) == object; | |
}else{ | |
throw "Promise not supported in your environment" | |
} | |
} | |
var i = 1; | |
var p = new Promise(function(resolve,reject){ |
Using rollup-plugin-vue |
Pure JavaScript Zoom and Pan, taken from http://phrogz.net/tmp/canvas_zoom_to_cursor.html
A Pen by TechSlides on CodePen.
// http://stackoverflow.com/questions/21961839/simulation-background-size-cover-in-canvas | |
function drawImageProp(ctx, img, x, y, w, h, offsetX, offsetY) { | |
if (arguments.length === 2) { | |
x = y = 0; | |
w = ctx.canvas.width; | |
h = ctx.canvas.height; | |
} | |
// default offset is center | |
offsetX = typeof offsetX === "number" ? offsetX : 0.5; |
.sidebar_newsletter_sign_up, | |
.sidebar_subscribe, | |
.sign-up-form-single, | |
.signup-form--header, | |
.signup-with-checkboxes, | |
.skinny-sign-up, | |
.slidedown-newsletter, | |
.small-newsletter, | |
.social-link-mail, | |
.social_newsletter_box, |
var webpack = require('webpack'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var path = require('path'); | |
var folders = { | |
APP: path.resolve(__dirname, '../app'), | |
BUILD: path.resolve(__dirname, '../build'), | |
BOWER: path.resolve(__dirname, '../bower_components'), | |
NPM: path.resolve(__dirname, '../node_modules') | |
}; |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |