Skip to content

Instantly share code, notes, and snippets.

Tamlyn Rhodes tamlyn

Block or report user

Report or block tamlyn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
branneman /
Last active Feb 20, 2020
Better local require() paths for Node.js

Better local require() paths for Node.js


When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

onjin / docker-compose.yml
Created Sep 5, 2016
example docker compose for postgresql with db init script
View docker-compose.yml
image: postgres:9.4
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

View capybara cheat sheet
=Clicking links and buttons=
click_link('Link Text')
click('Link Text') # Click either a link or a button
click('Button Value')
henriquea /
Last active Feb 17, 2020
Setting Fish as your default shell on Mac OS X
$ brew install fish
$ echo "/usr/local/bin/fish" | sudo tee -a /etc/shells
$ chsh -s `which fish`
pwenzel /
Last active Feb 17, 2020
Installing rbenv in a fish environment

Here we use Homebrew to install rbenv:

  1. brew update; and brew install rbenv ruby-build
  2. Add ~/.rbenv/shims to your PATH
  3. Include the contents of completions/ in your Fish config.
  4. Run rbenv install 2.2.2 and rbenv rehash
  5. Run rbenv global 2.2.2

Now you can run gem install bundler and bundle install within your Ruby project.

jlong / uri.js
Created Apr 20, 2012
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "";
parser.protocol; // => "http:"
parser.hostname; // => ""
parser.port; // => "3000"
parser.pathname; // => "/pathname/"; // => "?search=test"
parser.hash; // => "#hash"; // => ""
kasparsd /
Last active Feb 12, 2020
Using Git with Subversion Mirroring for WordPress Plugin Development
istepanov / gist:3950977
Created Oct 25, 2012
Remove PHPStorm settings from Mac OS X 10.8 Mountain Lion
View gist:3950977
rm -rf "$HOME/Library/Preferences/WebIde40"
rm -rf "$HOME/Library/Caches/WebIde40"
rm -rf "$HOME/Library/Application Support/WebIde40"
rm -rf "$HOME/Library/Logs/WebIde40"
samnang / gist:1759336
Created Feb 7, 2012
Install Bash version 4 on MacOS X
View gist:1759336
# Install Bash 4 using homebrew
brew install bash
# Or build it from source...
curl -O
tar xzf bash-4.2.tar.gz
cd bash-4.2
./configure --prefix=/usr/local/bin && make && sudo make install
# Add the new shell to the list of legit shells
You can’t perform that action at this time.