Skip to content

Instantly share code, notes, and snippets.

View colbypalmer's full-sized avatar
🦉

Colby Palmer colbypalmer

🦉
View GitHub Profile
@colbypalmer
colbypalmer / Mavericks_GCC_fix.txt
Last active August 29, 2015 14:02
Mavericks: fix for gcc error
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future [command]
@colbypalmer
colbypalmer / Mavericks: Install XCode command line tools
Created June 11, 2014 03:11
Mavericks: Install XCode command line tools
xcode-select --install
@colbypalmer
colbypalmer / 0_reuse_code.js
Created June 11, 2014 03:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@colbypalmer
colbypalmer / postgres_commands.sql
Last active August 29, 2015 14:02
List of useful Postgres commands
# Create database and user
CREATE DATABASE test_database;
CREATE USER tester WITH PASSWORD 'test_password';
GRANT ALL PRIVILEGES ON DATABASE "test_database" to tester;
# List all users
\du
# Delete a user with existing privileges
DROP OWNED BY <username>;
@colbypalmer
colbypalmer / MySQL Mavericks: install time zone definitions
Created June 11, 2014 06:15
MySQL / Mavericks: install time zone definitions for database and pytz
mysql_tzinfo_to_sql /usr/share/zoneinfo | sed -e "s/Local time zone must be set--see zic manual page/local/" | mysql -u root mysql
@colbypalmer
colbypalmer / traversebypairs.py
Created February 5, 2015 22:50
Traverse an array by pairs
# Used this to turn a 2-column spreadsheet to json key-value pairs
def traversebypairs(iterable):
a = iter(iterable)
return izip(a,a)
for a, b in traversebypairs(list):
print u'{{"{}", "{}"}},'.format(a, b)