Skip to content

Instantly share code, notes, and snippets.

View aheuermann's full-sized avatar

Andrew Heuermann aheuermann

View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 21, 2024 01:20
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@Kartones
Kartones / postgres-cheatsheet.md
Last active July 23, 2024 09:14
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@ianlintner-wf
ianlintner-wf / docker-machine-update-hosts.sh
Last active October 29, 2019 20:16
A basic shell script to use a configuration file to update local development hosts ip running on docker-machine (virtual box) and Mac OSX
#!/usr/bin/env bash
#Usage docker-machine-update-hosts.sh hosts.conf default
#arg1 is a configuration file with hosts
#arg2 is the docker-machine name e.g. default
DOCKER_IP=$(docker-machine ip $2)
echo "$2 ip: $DOCKER_IP"
#Remove existing lines from hosts
while IFS='' read -r line || [[ -n "$line" ]]; do
#!/usr/bin/env bash
list=( $(docker-machine ls | grep Running | awk '{ print $1 }') )
for i in "${list[@]}"; do
ip=$(docker-machine ip $i)
#remove line matching ip
sudo sed -i '' '/'$ip'/d' /etc/hosts
#insert ip/host on last line
sudo sed -i -e '$a\