Skip to content

Instantly share code, notes, and snippets.

View corbanb's full-sized avatar

corban baxter corbanb

View GitHub Profile
@corbanb
corbanb / gist:76d0658493e93830af48
Last active February 28, 2020 22:02 — forked from kirley/gist:3913166
Setting up PostGIS for Timezone Lookup
@corbanb
corbanb / .jshint
Created June 18, 2015 17:31
.jshintrc
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : false, // true: Require {} for every new block or scope
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
@corbanb
corbanb / banned.txt
Last active May 9, 2016 22:52
Banned and Blacklisted Usernames. Includes basic routes and curse words. Also other Profanity
4r5e
5h1t
5hit
God
God damn
Goddamn
a55
a_s_s
about
account
@corbanb
corbanb / readme.md
Last active June 11, 2016 19:11
PostgreSQL Useful commands

psql commands

Export to CSV

$ psql postgres://user:pass@localhost:1337/dbname -o 'file.csv' -F , --no-align -c 'SELECT * FROM column ORDER BY created_at ASC;'

Arrays

UPDATE "Jobs" SET "subscribers" = array_replace("subscribers", 'corbanb+plan@gmail.com', 'corbanb+plan2@gmail.com') WHERE "deletedAt" IS NULL AND 'corbanb+plan@gmail.com' = ANY ("subscribers")
@corbanb
corbanb / gist:de2830fa847d11b1fb95
Last active August 29, 2015 14:08
Heroku SSL + GoDaddy
@corbanb
corbanb / index.html
Created October 14, 2014 22:00
Facebook and Twitter Custom Shares
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<body>
@corbanb
corbanb / JavaScript.sublime-build
Last active May 2, 2022 22:56
Sublime Text - Tools > Build System > New Build System
// Sublime Text - Build System for Javascript
{
"cmd": ["node", "$file"],
"selector": "source.js"
}
@corbanb
corbanb / ie8-mq.html
Created September 23, 2014 17:43
ie8 media queries
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
@corbanb
corbanb / worker.js
Created August 31, 2014 18:50
Kue + RedisToGo + Heroku + Worker
var db = require('./db'),
TwitterController = require('./controllers/twitter'),
kue = require('kue'),
url = require('url');
var redisUrl = url.parse(process.env.REDISTOGO_URL);
var tc = new TwitterController();