Skip to content

Instantly share code, notes, and snippets.

View allolex's full-sized avatar
🏠
Working from home

Damon Davison allolex

🏠
Working from home
View GitHub Profile
@allolex
allolex / pr.md
Created May 9, 2016 16:37 — forked from piscisaureus/pr.md
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 = git@github.com:joyent/node.git

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:

@allolex
allolex / 1.never_boolean.md
Created October 6, 2015 20:15 — forked from eddroid/1.never_boolean.md
Ruby Refactorings

Never Boolean

You hardly ever have to use the word true in your code.

if (something == true)
  # do something cool
end

Can be rewritten as

##votersim.rb
class Person
attr_accessor :voters, :politicians
def initialize
@@voters = []
@@politicians = []
end
require './zoltar_module'
require './zoltar_helper'
include ZoltarSpeaks
intro
greeting
shall_we
which_fortune
answer = promptd
@allolex
allolex / unindent.rb
Last active August 29, 2015 14:06 — forked from avdi/unindent.rb
TEXT = <<EOF
See, the interesting thing about this text
is that while it seems like the first line defines an indent
it's actually the last line which has the smallest indent
there are also some blank lines
both with and without extra spaces in them
and it just goes on and on
# This file should be copy and pastable in bash or zsh.
# Homebrew uses this version as of this documentation's writing.
export POSTGRESQL_VERSION="2.1.3"
# 1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
## Start up the database. You can also use the launchctl method.
@allolex
allolex / web-servers.md
Last active December 19, 2015 07:19 — forked from willurd/web-servers.md
Make copy and pastable without shell prompts

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

python -m SimpleHTTPServer 8000