Skip to content

Instantly share code, notes, and snippets.

View cbartlett's full-sized avatar

Colin Bartlett cbartlett

View GitHub Profile
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
Shoes.setup do
gem "mime-types"
gem "open4"
source "http://gems.github.com/"
gem "mojombo-grit"
end
require 'mojombo-grit'
repo = Grit::Repo.new(Dir.pwd)
#!/usr/bin/env ruby
require 'json'
if ARGV.length < 3 then
puts "Usage: squirt <filename> <channel> <comment>"
exit
end
token = ENV['TOKEN'] || ""
#! /bin/bash
# directory to save backups in, must be rwx by postgres user
BASE_DIR="/var/backups/postgres"
YMD=$(date "+%Y-%m-%d")
DIR="$BASE_DIR/$YMD"
mkdir -p $DIR
cd $DIR
# make database backup
@cbartlett
cbartlett / info.plist
Created October 13, 2015 23:55 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
=== Things to do in NYC with a ~7 Year Old ===
Brooklyn
Williamsburg
- McCarren Park
- Pool
- Brooklyn Flea - Sunday 10-4
- East River State Park
- Brooklyn Bowl - Sat/Sun 12-6
- Leonard Library - Mon-Sun 10-6
@cbartlett
cbartlett / bitly.rb
Created November 7, 2013 20:43 — forked from jehiah/bitly.rb
# Bit.ly API implementation - thanks to Richard Johansso http://gist.github.com/112191
require 'httparty'
class Api::Bitly
include HTTParty
base_uri 'api.bit.ly'
format :json
# Usage: Bitly.shorten("http://example.com")
def self.shorten(url)
@cbartlett
cbartlett / pr.md
Created April 29, 2017 22:01 — 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:

@cbartlett
cbartlett / pr.md
Created April 29, 2017 22:01 — 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: