Skip to content

Instantly share code, notes, and snippets.

View corbanb's full-sized avatar

corban baxter corbanb

View GitHub Profile
@corbanb
corbanb / cron.php
Created March 3, 2014 20:44
Backup database to S3 bucket
<?php
$date = date("Y-m-dTH:i:s");
$file = 'db.backup.' . $date . '.sql.gz';
error_log("Database Backup Started - " . $file);
exec('touch ' . $file);
exec('chmod 600 ' . $file);
exec('mysqldump -u user --password="password" --add-drop-table --single-transaction database_name | gzip > ' . $file);
@corbanb
corbanb / developer-setup.md
Last active August 29, 2015 13:59 — forked from saetia/gist:1623487
OSX - PHP/Ruby/Node - Developer Setup
@corbanb
corbanb / README.md
Last active August 29, 2015 14:00
Simple method for subscribing and unsubscribing up users in Exact Target using the SOAP API w/ the savon gem

Thanks @MichaelAllenClark for the help with his examples. Not sure why this info wasn't on the code.exacttarget.com website to begin with.

@corbanb
corbanb / lsof-3000.sh
Created June 18, 2014 20:55
list open processes on port
# useful for rails server already running message
lsof -wni tcp:3000
@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 / 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 / gist:de2830fa847d11b1fb95
Last active August 29, 2015 14:08
Heroku SSL + GoDaddy
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 / .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
@corbanb
corbanb / postgres_meta_info.md
Created July 30, 2015 23:27
Postgres Meta Info

Postgres Meta Info

Source - Here

List Tables

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