Skip to content

Instantly share code, notes, and snippets.

View matthewhartman's full-sized avatar

Matthew Hartman matthewhartman

View GitHub Profile
@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

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 / 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"
@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 / 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"
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 / bash_rc
Created November 11, 2015 10:08
Git Bash Script
# Handy bash script for showing your current branch
PS1='[VM] \[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '
@matthewhartman
matthewhartman / install-fonts.txt
Created March 1, 2015 11:27
Install TTF Fonts in Debian
cd fonts
mv *.ttf /usr/share/fonts/truetype
cd /usr/share/fonts/truetype
mkfontscale
mkfontdir
fc-cache
xset fp rehash
@matthewhartman
matthewhartman / rc.xml
Last active September 28, 2016 02:36
HP Stream 11 - Debian 8 - Openbox Configuration
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
@matthewhartman
matthewhartman / menu.xml
Created July 23, 2014 12:15
Openbox Menu Config
<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openbox.org/">
<menu id="root-menu" label="Openbox 3">
<item label="Web Browser">
<action name="Execute">
<command>
x-www-browser
</command>
</action>
</item>