Skip to content

Instantly share code, notes, and snippets.

View wookiehangover's full-sized avatar
💭
just setting up my gthb...

Sam Breed wookiehangover

💭
just setting up my gthb...
View GitHub Profile
@wookiehangover
wookiehangover / gist:3947778
Created October 24, 2012 18:10
redis manual migrations
redis-cli -h someUrlWithaRedisServer.com -p 9258 -a PASSWORD
hmget deal:kbfpx0ezv dealType
1) "\"Mens\""
hmset deal:kbfpx0ezv dealType "\"Men's\""
OK
<?php
//example of how to override parts of the config
return $config = _cfg(array(
// This is your local development subdomain:
'home.subdomain' => 'newfw.local.dev',
// This is a subdomain that serves the legacy site, if omitted, defaults to production:
'home.old.subdomain' => 'staging.qa',
[
{
"storyMediaId": 1,
"storyOrder": 1,
"size": "cover"
},
{
"storyMediaId": 77,
"storyOrder": 3,
"size": "large"
@wookiehangover
wookiehangover / wo0kie.zsh-theme
Created September 7, 2012 18:53
wo0kie.zsh-theme
if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi
local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})"
PROMPT='
%{$fg[cyan]%}%n%{$reset_color%}%{$fg[yellow]%}@%{$reset_color%}%{$fg[blue]%}%m%{$reset_color%}: %{${fg[green]}%}%~%{$reset_color%}$(git_prompt_info)
%{${fg[$CARETCOLOR]}%}∴ %{${reset_color}%}'
RPROMPT='%{$fg[magenta]%} %W - %*%{$reset_color%}'
@wookiehangover
wookiehangover / events.js
Created September 6, 2012 04:33
An EventEmitter you can use in the client
define(function(){
function EventEmitter(){}
var isArray = typeof Array.isArray === 'function'
? Array.isArray
: function (xs) {
return Object.prototype.toString.call(xs) === '[object Array]'
}
;
[2012-08-31T11:50:41-06:00][ef693ace] WARN (Pb\Service\ActivityStream\ActivityStreamService) "Error publishing activity stream event: exception 'Zend_Queue_Exception' with message 'Could not write to any server for activity' in /Users/sam/dev/photobucket/pbtng/lib/ZendPb/Queue/Adapter/Kestrel.php:403
Stack trace:
#0 /Users/sam/dev/photobucket/pbtng/lib/ZendPb/Queue/Adapter/Fanout.php(280): ZendPb_Queue_Adapter_Kestrel->send('{"time":1346435...', NULL)
#1 /Users/sam/dev/photobucket/pbtng/lib/Zend/Queue.php(416): ZendPb_Queue_Adapter_Fanout->send('{"time":1346435...')
#2 /Users/sam/dev/photobucket/pbtng/lib/Pb/Service/ActivityStream/ActivityStreamService.php(225): Zend_Queue->send('{"time":1346435...')
#3 [internal function]: Pb\Service\ActivityStream\{closure}(Object(Zend2\EventManager\Event))
#4 /Users/sam/dev/photobucket/pbtng/lib/Zend2/EventManager/EventManager.php(465): call_user_func(Object(Closure), Object(Zend2\EventManager\Event))
#5 /Users/sam/dev/photobucket/pbtng/lib/Zend2/EventManager/EventManager
exception 'Exception' with message 'Invalid path: /albums' in /Users/sam/dev/photobucket/pbtng/lib/Pb/Model/Path/PBPath.php:77
Stack trace:
#0 /Users/sam/dev/photobucket/pbtng/lib/Pb/Model/Path/PBPath.php(48): Pb\Model\Path\PBPath->parsePath()
#1 /Users/sam/dev/photobucket/pbtng/lib/Pb/Model/Path/PBPath.php(223): Pb\Model\Path\PBPath->__construct('/albums')
#2 /Users/sam/dev/photobucket/pbtng/lib/Pb/Dao/Filesystem/AlbumFilesystemDao.php(274): Pb\Model\Path\PBPath->getParentPath()
#3 /Users/sam/dev/photobucket/pbtng/lib/Pb/Dao/Filesystem/AlbumFilesystemDao.php(38): Pb\Dao\Filesystem\AlbumFilesystemDao->filesystemElementForPath(Object(Pb\Model\Path\PBPath))
#4 /Users/sam/dev/photobucket/pbtng/lib/Pb/Dao/Album/AlbumDao.php(200): Pb\Dao\Filesystem\AlbumFilesystemDao->findByPath(Object(Pb\Model\Path\PBPath))
#5 /Users/sam/dev/photobucket/pbtng/lib/Pb/Service/Album/AlbumService.php(96): Pb\Dao\Album\AlbumDao->findByOwnerAndPath(Object(Pb\Model\User\User), Object(Pb\Model\Path\PBPath))
#6 /Users/sam/dev/photobucket/
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
npm http GET https://isaacs.iriscouch.com/registry/_design/app/_rewrite/read/-/read-1.0.3.tgz
npm ERR! fetch failed https://isaacs.iriscouch.com/registry/_design/app/_rewrite/read/-/read-1.0.3.tgz
npm http GET https://isaacs.iriscouch.com/registry/_design/app/_rewrite/read/-/read-1.0.3.tgz
npm ERR! fetch failed https://isaacs.iriscouch.com/registry/_design/app/_rewrite/read/-/read-1.0.3.tgz
npm ERR! Error: SSL Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! at ClientRequest.<anonymous> (/Users/sam/Developer/.nvm/v0.8.6/lib/node_modules/npm/node_modules/request/main.js:440:26)
npm ERR! at ClientRequest.g (events.js:185:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:88:17)
npm ERR! at HTTPParser.parserOnIncomingClient (http.js:1455:7)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)
@wookiehangover
wookiehangover / gist:3266276
Created August 5, 2012 17:51
Uploads Formidable file objects to S3, save to redis
// Uploads Formidable file objects to S3, save to redis
//
// TODO - add image processing task
var fs = require('fs');
var s3 = require('knox').createClient();
var redis = require('redis');
var client = redis.createClient();
function update( data, cb ){