Skip to content

Instantly share code, notes, and snippets.

View ehaughee's full-sized avatar

Eric Haughee ehaughee

View GitHub Profile
@jihuichoi
jihuichoi / keybindings.json
Created August 22, 2019 09:55
to navigate backward/forward using mouse button 4,5 on mac
[
// move backward/forward using mouse button 4, 5
{ // remove exsiting bind
"key": "",
"command": "editor.action.indentLines",
"when": "editorTextFocus && !editorReadonly"
},
{ // remove exsiting bind
"key": "",
@sonOfRa
sonOfRa / mergetoolwrapper.sh
Last active August 29, 2022 09:57
Use Sublime Merge as a git mergetool
#!/bin/bash
# A wrapper script to make sublime_merge work more nicely
# when used as a git-mergetool
WORKDIR=`git rev-parse --show-toplevel`
REAL_HOME="$HOME/"
# Replace a leading homedir with ~/ to match the window title
REAL_WORKDIR=${WORKDIR/"^$REAL_HOME"/"~/"}
sublime_merge $REAL_WORKDIR
@sloanlance
sloanlance / disable_macOS_parental_controls.sh
Last active September 7, 2021 16:00
Disable Parental Controls and other services in macOS Sierra (OS X)
#!/bin/bash
# This is a draft but it works
# FIRST (I don't even know if it works but we'll assume yes)
# sudo launchctl list
# sudo launchctl disable system/netbiosd
# sudo launchctl disable system/parsecd
# sudo launchctl disable system/parentalcontrols.check
# sudo launchctl disable system/airportd
@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@haacked
haacked / encouragements.txt
Created August 6, 2014 21:45
My Encouragements
😱 Seriously?
😷 That's a bad look.
Burn it to the ground! 🔥
😠 Torvalds frowns at you.
🚶 Have you considered another career?
You must hate your coworkers. 👹
😡 You must hate yourself.
Ha! Yeah, that'll work. 😄
😕 Are you just hitting keys at random?
You code like a PM. 😐
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

# Allows for any file to be extracted using: x $1
x () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
@ehaughee
ehaughee / regexres.md
Last active May 10, 2020 22:41
Regular Expression Resources
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname