Skip to content

Instantly share code, notes, and snippets.

View joelkallman's full-sized avatar

Joel Kallman joelkallman

View GitHub Profile
@joelkallman
joelkallman / rsvp-extension.js
Created March 1, 2014 20:52
Ember RSVP spread method
(function (RSVP) {
if (!RSVP) {
return;
}
/**
Spread is utilized with the all() method.
Basic Usage:
@joelkallman
joelkallman / ember-addRoute.js
Created July 30, 2013 15:45
Dynamically Add Routes in Ember.Router
/**
* Add Route
*
* This will dynamically create the following routes for the name passed.
* Anywhere you see "name" below, replace with the passed param for name.
* e.g. addRoute(this, "posts") -> URL = "/posts", Route = PostsIndexRoute, etc.
*
* IMPORTANT: All templates render INTO "name" parent template. Put an {{outlet}} there
*
* URL | Route Name | Controller | Template
@joelkallman
joelkallman / pg_backup_rotated.sh
Created July 16, 2013 17:31
PostgreSQL Backup Rotated Shell Script
#!/bin/bash
###########################
####### LOAD CONFIG #######
###########################
SCRIPTPATH=$(cd ${0%/*} && pwd -P)
source $SCRIPTPATH/pg_backup.config
@joelkallman
joelkallman / pg_backup.sh
Last active December 19, 2015 20:08
PostgreSQL Backup Script
#!/bin/bash
###########################
####### LOAD CONFIG #######
###########################
while [ $# -gt 0 ]; do
case $1 in
-c)
if [ -r "$2" ]; then
@joelkallman
joelkallman / pg_backup.config
Created July 16, 2013 17:26
PostgreSQL Configuration File
##############################
## POSTGRESQL BACKUP CONFIG ##
##############################
# Optional system user to run backups as. If the user the script is running as doesn't match this
# the script terminates. Leave blank to skip check.
BACKUP_USER=
# Optional hostname to adhere to pg_hba policies. Will default to "localhost" if none specified.
HOSTNAME=
@joelkallman
joelkallman / dir_transfer.sh
Created July 16, 2013 17:16
Recursive Directory File Transfer
#!/bin/bash
# Edit these vars for transfer process
HOST="user@host-or-ip"
LOCALDIR="/var/backups/database"
REMOTEDIR="/path/to/base-dir"
MVDIR="/var/moved-backups/database"
# Transfer Files to external server
scp -P 22 -r $LOCALDIR $HOST":"$REMOTEDIR
<?php
/*
Author: Jim Westergren & Jeedo Aquino
File: index-with-redis.php
Updated: 2012-10-25
This is a redis caching system for wordpress.
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
<?php
/*
Author: Jim Westergren & Jeedo Aquino
File: index-with-redis.php
Updated: 2012-10-25
This is a redis caching system for wordpress.
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
@joelkallman
joelkallman / Eclarian_TestCase.php
Created December 12, 2012 19:05
Extension of PHPUnit_Framework_TestCase for easy access to objects private/protected properties and methods. This allows you maintain proper visibility for methods and properties within your classes while still being able to test fully.
<?php
/**
* Eclarian Test Case
*
* Adds callPrivate() and getPrivateProperty() to be able to test
* the full class without having to set everything as public
*
* @package Eclarian
* @copyright Copyright (c) 2012, Eclarian, LLC.