Skip to content

Instantly share code, notes, and snippets.

Avatar

Jared Reich jaredreich

View GitHub Profile
@jaredreich
jaredreich / spacer.bash
Created Oct 1, 2018
How to add spaces to your Mac's Dock using Terminal
View spacer.bash
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
View uninstall_n.md
sudo n prune
sudo npm uninstall -g n
sudo rm -r /usr/local/n
sudo rm /usr/local/bin/node
@jaredreich
jaredreich / delete_node_modules.sh
Last active Jul 10, 2018
Delete all node_modules
View delete_node_modules.sh
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
# or with trash-cli
find . -name node_modules -type d -prune -exec trash {} +
@jaredreich
jaredreich / script.txt
Created Apr 9, 2018
Run webpack with more memory space
View script.txt
node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js
View international_ip_addresses.txt
AU: 103.25.59.108
GB: 159.65.60.201
US: 35.226.78.115
@jaredreich
jaredreich / full_path_macos_finder_title_bar.txt
Last active Mar 18, 2018
Show full path in macOS finder title bar
View full_path_macos_finder_title_bar.txt
ON:
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true; killall Finder
OFF:
defaults write com.apple.finder _FXShowPosixPathInTitle -bool false; killall Finder
@jaredreich
jaredreich / client.js
Created Feb 27, 2018
iframe scroll to bottom detection (cross browser, including mobile safari)
View client.js
window.addEventListener('scroll', handleScroll);
window.addEventListener('message', handleMessage);
handleMessage = (event) => {
if (event.data === 'scrolledToBottom') handleScrolledToBottom();
}
handleScroll = () => {
if ((window.innerHeight + window.pageYOffset) >= window.document.body.scrollHeight) {
this.handleScrolledToBottom();
View keybase.md

Keybase proof

I hereby claim:

  • I am jaredreich on github.
  • I am jaredreich (https://keybase.io/jaredreich) on keybase.
  • I have a public key ASCnzRC35EEGKbWFMBYHVcj6t97dtlr8DzS2_Mj7lqc16go

To claim this, I am signing this object:

@jaredreich
jaredreich / index.html
Created Sep 30, 2017
Text gradient with CSS
View index.html
<h1>
The quick brown fox jumped over the lazy dog.
</h1>
@jaredreich
jaredreich / uuid-v4.js
Last active Mar 7, 2017
Generate an RFC4122 version 4 compliant UUID
View uuid-v4.js
const generateUUID = () => (
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
const r = Math.random() * 16 | 0
const v = c === 'x' ? r : (r & 0x3 | 0x8)
return v.toString(16)
})
)
You can’t perform that action at this time.