Skip to content

Instantly share code, notes, and snippets.

corban baxter corbanb

Block or report user

Report or block corbanb

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
@corbanb
corbanb / cities.json
Created Oct 16, 2017 — forked from Miserlou/cities.json
1000 Largest US Cities By Population With Geographic Coordinates, in JSON
View cities.json
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
View gist:fb652d43939423e3f4d95cae0c3e347c
function create_branch_pr {
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
remote=$(git config remote.origin.url | cut -d. -f1-2)
echo "$remote/compare/develop...updates/$branch"
}
alias opr='open -a /Applications/Google\ Chrome.app $(create_branch_pr)'
@corbanb
corbanb / pre-request-jwt.js
Last active Jul 16, 2019
JWT tokenize - Postman Pre-Request Script
View pre-request-jwt.js
function base64url(source) {
// Encode in classical base64
encodedSource = CryptoJS.enc.Base64.stringify(source);
// Remove padding equal characters
encodedSource = encodedSource.replace(/=+$/, '');
// Replace characters according to base64url specifications
encodedSource = encodedSource.replace(/\+/g, '-');
encodedSource = encodedSource.replace(/\//g, '_');
@corbanb
corbanb / post-merge
Created May 20, 2016 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
View post-merge
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@corbanb
corbanb / profanity.csv
Created May 9, 2016 — forked from tjrobinson/profanity.csv
Profanity list for use with content filters
View profanity.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
amcik
arse
arsehole
arserape
arsewipe
ass
asses
asshole
assholes
assramer
View bit.zsh
# Opens the bitbucket page for the current git repository in your browser
function bit() {
giturl=$(git config --get remote.origin.url)
if [ "$giturl" == "" ]
then
echo "Not a git repository or no remote.origin.url set"
exit 1;
fi
View cleanup-ssh.sh
#!/bin/bash
if [ "$GIT_SSH_KEY" != "" ]; then
echo "Cleaning up SSH config" >&1
echo "" >&1
# Now that npm has finished running,
# we shouldn't need the ssh key/config anymore.
# Remove the files that we created.
rm -f ~/.ssh/config
rm -f ~/.ssh/deploy_key
@corbanb
corbanb / postgis.md
Last active Aug 29, 2015
Heroku Postgres Helpers
View postgis.md

Reverse geometry cords

Sets points lat,lng to lng,lat which is the prefferred format for postgis

UPDATE "Locations" SET geo = point(geo[1], geo[0]);

Export single table data

@corbanb
corbanb / dev-node.md
Last active Jul 14, 2018
OSX 10.10.X Node Developer Setup
View dev-node.md

Node.js + OSX 10.10.X

Outline

Below is a quick start guide to developing node.js on OSX. These tools and settings will give you just about everything you would need on a clean install of OSX 10.10.X to get setup and coding.

Install iTerm2

https://www.iterm2.com

Install XCode

View postgres_meta_info.md

Postgres Meta Info

Source - Here

List Tables

Here's the query that will return the names of the tables defined in the current database:

You can’t perform that action at this time.