Skip to content

Instantly share code, notes, and snippets.

View CraigMorton's full-sized avatar

Craig Morton CraigMorton

View GitHub Profile
@CraigMorton
CraigMorton / brew_packages_full_reinstall.md
Last active January 9, 2024 13:09
brew full reinstall all packages

This forces a full reinstall of all homebrew packages, fixing the dyld: Library not loaded errors when trying to run git, psql, node etc. This often happens after using Apple's Migration Assistant. Also can be caused by macOS updates.

brew list -1 > brew.txt # list out all installed packages
brew list -1 | xargs brew rm --force # remove all installed packages
brew install $(cat brew.txt | tr '\n' ' ') # install all previously installed packages

source

To create a idea command in your terminal to open a given project directory with IntelliJ IDEA, type the following command in terminal

alias idea="open -a 'IntelliJ IDEA CE' $@"

To keep this alias every time you open a new terminal in future, add the above line anywhere in your ~/.zshrc file.

@CraigMorton
CraigMorton / History|-16079449|entries.json
Last active January 2, 2024 19:21
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/craig/wd/clicker_rpg/src/state/queue.ts","entries":[{"id":"hBtk.ts","timestamp":1675706728807},{"id":"IMZ4.ts","timestamp":1675706773377},{"id":"R1uL.ts","timestamp":1675706809037},{"id":"lIDB.ts","timestamp":1675706859832},{"id":"8Ijn.ts","timestamp":1675706878092},{"id":"ppsg.ts","timestamp":1675706895843},{"id":"Notm.ts","timestamp":1675707313532},{"id":"LoIc.ts","timestamp":1675728936484},{"id":"5sGy.ts","timestamp":1675729071257},{"id":"zeOB.ts","timestamp":1675729107858},{"id":"Xr9d.ts","timestamp":1675729130863},{"id":"ufhD.ts","timestamp":1675729236468},{"id":"yp6Y.ts","timestamp":1675729263876},{"id":"1g7v.ts","timestamp":1675729318527},{"id":"al0B.ts","timestamp":1675729363352},{"id":"w1lZ.ts","timestamp":1675729397174},{"id":"yro5.ts","timestamp":1675731372650},{"id":"Q1fd.ts","timestamp":1675734460778},{"id":"ADKf.ts","timestamp":1675772760379}]}
@CraigMorton
CraigMorton / cloudSettings
Created January 28, 2019 15:34
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-28T15:34:09.186Z","extensionVersion":"v3.1.2"}
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
echo "Installing and configuring Awesome Print for IRB"
gem install 'awesome_print'
cat >> "$HOME/.irbrc" << EOM
require "awesome_print"
AwesomePrint.irb!
require 'irb/completion'
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:SAVE_HISTORY] = 1000
VERB PATH ACTION
GET /pizzas index
GET /pizzas/:id show
GET /pizzas/new new
POST /pizzas create
GET /pizzas/:id/edit edit
POST /pizzas/:id update
POST /pizzas/:id/delete destroy
a_string = String.new('a_string')
another_string = String.new('another_string')
puts a_string
puts a_string.hash
puts another_string
puts another_string.hash
puts a_string.hash == another_string.hash
a_hash = {}
VERB PATH ACTION
GET /pizzas index
GET /pizzas/:id show
GET /pizzas/new new
POST /pizzas create
GET /pizzas/:id/edit edit
POST /pizzas/:id update
POST /pizzas/:id/delete destroy
#!/bin/sh
# Uninstall Android Studio
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*