Skip to content

Instantly share code, notes, and snippets.

View matthewhartman's full-sized avatar

Matthew Hartman matthewhartman

View GitHub Profile
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.6-yakkety/linux-headers-4.6.0-040600_4.6.0-040600.201605151930_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.6-yakkety/linux-headers-4.6.0-040600-generic_4.6.0-040600.201605151930_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.6-yakkety/linux-image-4.6.0-040600-generic_4.6.0-040600.201605151930_amd64.deb
sudo dpkg -i linux-headers-4.6.0*.deb linux-image-4.6.0*.deb
sudo update-grub
@matthewhartman
matthewhartman / settings.json
Created April 18, 2017 11:16
MS Code Settings
// Place your settings in this file to overwrite the default settings
{
"http.proxyStrictSSL":false,
"standard.enable": true,
"files.autoSave": "on",
"window.zoomLevel": 0,
"workbench.welcome.enabled": false,
"editor.minimap.enabled": true,
"emmet.syntaxProfiles": {
"javascript": "html"
@matthewhartman
matthewhartman / tab-trigger.js
Created June 16, 2017 12:08 — forked from wesbos/tab-trigger.js
How to properly get a TAB trigger working with Emmet inside of JSX
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
@matthewhartman
matthewhartman / multiple_ssh_setting.md
Created October 18, 2017 09:48 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"

Difference between Debounce and Throttle

Debounce

Debounce a function when you want it to execute only once after a defined interval of time. If the event occurs multiple times within the interval, the interval is reset each time.
Example A user is typing into an input field and you want to execute a function, such as a call to the server, only when the user stops typing for a certain interval, such as 500ms.

Throttle

@matthewhartman
matthewhartman / record-screen.sh
Created February 8, 2018 07:38
Record Screen as Gif
byzanz-record --duration=7 --x=0 --y=0 --width=1366 --height=768 output.gif
@matthewhartman
matthewhartman / useRouter.js
Created March 21, 2019 07:16 — forked from tim-field/useRouter.js
Hooks Router
import { useEffect, useState } from "react"
import { createBrowserHistory } from "history"
const history = createBrowserHistory()
const trim = url => url.replace(/^\/|\/$/g, "")
function useRouter(initial = "") {
const [route, setRoute] = useState(initial)
useEffect(() => {
const { pathname, search } = new URL(route, window.location.href)
@matthewhartman
matthewhartman / log-json.js
Last active May 4, 2019 02:57
Console Log Object and Output to JSON
// in dev tools, right click on object and `store as global variable`
JSON.stringify(temp1, null, 2) // 2 tab spacing
@matthewhartman
matthewhartman / my-gulp-4-file.js
Last active June 2, 2021 20:35
My Gulp 4 File / Setup
const { watch, src, dest, parallel } = require('gulp');
const sass = require('gulp-sass');
const cssnano = require('cssnano');
const sourcemaps = require('gulp-sourcemaps');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const concat = require('gulp-concat');
const browserSync = require('browser-sync');
const newer = require('gulp-newer');
const imagemin = require('gulp-imagemin');
@matthewhartman
matthewhartman / package.json
Created March 2, 2020 08:57
Parcel Configuration for Typescript
{
"name": "parcel-example",
"version": "1.0.0",
"description": "A basic setup using Parcel - A blazing fast, zero configuration web application bundler",
"scripts": {
"start": "NODE_ENV=development parcel src/index.html --open",
"build": "NODE_ENV=production rm -rf dist && tsc --noEmit && parcel build src/index.html",
"clean": "rm -rf dist"
},
"private": true,