Skip to content

Instantly share code, notes, and snippets.

View corbanb's full-sized avatar

corban baxter corbanb

View GitHub Profile
var App = App || {};
App.Helpers = App.Helpers || {};
(function($) {
'use strict';
App.Helpers.Numbers = {
@corbanb
corbanb / default.conf
Last active May 23, 2020 12:22
Nginx redirect assets to CDN from Wordpress
server {
## Your website name goes here.
server_name domainname.com www.domainname.com _;
## Your only path reference.
root /var/www/;
listen 8080;
## This should be in your http block and if it is, it's not needed here.
index index.html index.htm index.php;
include conf.d/drop;
@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 / developer-resources.md
Last active May 17, 2016 08:25
Creative Developer Resources
@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 / api_cache.php
Created June 2, 2014 20:22
Simple API caching with PHP
<?php
/**
* API Request Caching
*
* Use server-side caching to store API request's as JSON at a set
* interval, rather than each pageload.
*
* @arg Argument description and usage info
*/
@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 / bash_commands.txt
Created July 7, 2014 20:33
helpful bash commands
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest. Come back soon for more!
BASH
* In bash, 'ctrl-r' searches your command history as you type
- Input from the commandline as if it were a file by replacing
'command < file.in' with 'command <<< "some input text"'
- '^' is a sed-like operator to replace chars from last command
'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty.
* '!!:n' selects the nth argument of the last command, and '!$' the last arg
@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();