Skip to content

Instantly share code, notes, and snippets.

var uiRouter = require('./common/angular-ui-router'),
common = require('./common/common'),
home = require('./home'),
signup = require('./account');
angular.module('sw', [
'sw.home',
'sw.signup',
'ui.router',
'sw.common'
var express = require('express'),
http = require('http'),
longRes = require('./data'),
app = express();
app.disable('x-powered-by');
// this is the function utilized to stage a request
express.response.stage = function(body, cb) {
this.stagedResponse = {body: body}
#!/bin/bash
#
# Argument = -u user -p password -k key -s secret -b bucket
#
# To Do - Add logging of output.
# To Do - Abstract bucket region to options
set -e
export PATH="$PATH:/usr/local/bin"
function force_of_gravity() { ?>
if (get_post_meta(get_the_ID(), "image", true)) || (get_post_meta(get_the_ID(), "text", true)) { ?>
<b>Submitted by: </b><?php echo get_post_meta(get_the_ID(), "name", true) ?> in <?php echo get_post_meta(get_the_ID(), "location", true); ?>
<?php endif; ?>
<?php
}
add_action('thesis_hook_before_content', 'force_of_gravity');
function force_of_gravity() {
if (get_post_meta(get_the_ID(), "image", true)) || (get_post_meta(get_the_ID(), "text", true)): ?>
<b>Submitted by: </b><?php echo get_post_meta(get_the_ID(), "name", true) ?> in <?php echo get_post_meta(get_the_ID(), "location", true); ?>
<?php endif; ?>
<?php
}
add_action('thesis_hook_before_content', 'force_of_gravity');
/media/*
/var/*
/app/etc/local.xml
/app/etc/use_cache.ser
/nbproject/*
/downloader/pearlib/cache/*
/downloader/pearlib/download/*
/downloader/pearlib/temp/*
/.htaccess
.svn
@shanestillwell
shanestillwell / time.php
Created October 29, 2010 18:00
PHP array of time in 15 minute increments
$time = array(
"5:00 AM" => "5:00 AM",
"5:15 AM" => "5:15 AM",
"5:30 AM" => "5:30 AM",
"5:45 AM" => "5:45 AM",
"6:00 AM" => "6:00 AM",
"6:15 AM" => "6:15 AM",
"6:30 AM" => "6:30 AM",
"6:45 AM" => "6:45 AM",
@shanestillwell
shanestillwell / provinces.xml
Created October 29, 2010 19:28
Provinces in XML format
<?xml version="1.0" encoding="UTF-8"?>
<countries>
<AD>
<region>Andorra</region>
<region>Parròquia de Canillo</region>
<region>Parròquia d'Encamp</region>
<region>Parròquia de la Massana</region>
<region>Parròquia d'Ordino</region>
<region>Parròquia de Sant Julià de Lòria</region>
<region>Parròquia d'Andorra la Vella</region>
@shanestillwell
shanestillwell / recursive.php
Created December 27, 2010 20:25
Recursive Array Search
// Recursivly search through an array, if the key is found, then return TRUE
private function _recursiveArraySearch($haystack, $needle, $index = null)
{
$aIt = new RecursiveArrayIterator($haystack);
$it = new RecursiveIteratorIterator($aIt);
while($it->valid())
{
if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle)) {
//return $aIt->key();
@shanestillwell
shanestillwell / test_zend_auth_login
Created December 27, 2010 20:27
Create an instance of Zend_Auth with the user_id you want.
protected function _logIn($id = 4)
{
$user = Doctrine_Core::getTable('Default_Model_User')->find(4);
Zend_Auth::getInstance()->getStorage()->write($user);
}