Skip to content

Instantly share code, notes, and snippets.

View cgarvis's full-sized avatar
👋

Chris Garvis cgarvis

👋
View GitHub Profile
@cgarvis
cgarvis / vbox
Created October 12, 2011 14:29
Commandline for starting/stopping vboxes in headless mode
#!/bin/sh
E_NOARGS=85
if [[ -z "$1" || -z "$2" ]]; then
[[ "$1" == "list" ]] || ( echo "Usage: `basename $0` [list|start|pause|stop] vm-name"; exit $E_NOARGS; )
fi
case $1 in
"list" | "ls" )
@cgarvis
cgarvis / gist:1487633
Created December 16, 2011 19:45
Checking out json_server
git checkout development
git branch -D json_server
git fetch
git checkout -b json_server origin/json_server
@cgarvis
cgarvis / gist:1512133
Created December 22, 2011 22:31
override plugin template with one in the app
$this->_render['paths']['template'] = array(
LITHIUM_APP_PATH . '/views/{:controller}/{:template}.{:type}.php',
'{:library}/views/{:controller}/{:template}.{:type}.php'
);
@cgarvis
cgarvis / brew-log-tmux-install
Created January 17, 2012 20:06
Brew failure to install tmux
➜ ~ brew install -v tmux
==> Downloading http://sourceforge.net/projects/tmux/files/tmux/tmux-1.5/tmux-1.5.tar.gz
File already downloaded in /Users/cgarvis/Library/Caches/Homebrew
/usr/bin/tar xf /Users/cgarvis/Library/Caches/Homebrew/tmux-1.5.tar.gz
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/tmux/1.5 --sysconfdir=/usr/local/etc
./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/tmux/1.5 --sysconfdir=/usr/local/etc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... etc/install-sh -c -d
checking for gawk... no
@cgarvis
cgarvis / drush-test
Created January 20, 2012 16:56
li3 and drupal intergration
[vagrant@localhost drupal]$ drush test-run Arwen -v
Initialized Drupal 7.9 root directory at /opt/ivillage/drupal/www [notice]
Initialized Drupal site local.ivillage.com at sites/default [notice]
/usr/bin/php /usr/share/pear/drush/drush.php --php=/usr/bin/php --verbose --root=/opt/ivillage/drupal/www --uri=http://local.ivillage.com/ test-run ArwenTestCase --backend=2 2>&1
<?php
namespace app\extensions\helper;
class Form extends \lithium\template\helper\Form {
public function field($name, array $options = array()) {
$defaults = array(
'wrap' => 'control-group'
);
return parent::field($name, $options + $defaults);
diff --git a/tests/cases/net/socket/CurlTest.php b/tests/cases/net/socket/CurlTest.php
index 21a9dce..f874974 100644
--- a/tests/cases/net/socket/CurlTest.php
+++ b/tests/cases/net/socket/CurlTest.php
@@ -138,6 +138,20 @@ class CurlTest extends \lithium\test\Unit {
$stream->set('DummyFlag', 'Changed Dummy Value');
$this->assertEqual('Changed Dummy Value', $stream->options['DummyFlag']);
}
+
+ public function testSendPostThenGet() {
@cgarvis
cgarvis / lithium-test-5.3-5.4.diff
Created February 10, 2012 18:10
Lithium test diff between 5.3 and 5.4
3c3
< 5 fails and 5 exceptions
---
> 5 fails and 7 exceptions
6c6
< 32lithium\test\{closure} @ ?, line 710
---
> 32lithium\test\Unit::lithium\test\{closure}() @ ?, line 710
18c18
< 44lithium\console\command\{closure} @ ?, line 71
@cgarvis
cgarvis / moveline.zsh-theme
Created January 22, 2013 18:08
ZSH Theme for Moveline
# ------------------------------------------------------------------------
# Christopher Garvis
# oh-my-zsh theme
# Totally ripped-off Tyler Cipriani
# ------------------------------------------------------------------------
# Grab the current date (%W) and time (%t):
#bold MOVELINE_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %{$fg_bold[yellow]%}%W%{$reset_color%}@%{$fg_bold[white]%}%t )( %{$reset_color%}"
MOVELINE_TIME_="%{$fg[red]%}#%{$fg_bold[white]%}( %{$fg[yellow]%}%W%{$reset_color%}@%{$fg_bold[white]%}%t )( %{$reset_color%}"
@cgarvis
cgarvis / create_customer.rb
Created March 12, 2013 17:35
Possible approach to a hexagonal gem with rspec test
module HexagonalGem
class CreateCustomer
attr_reader :listener, :validator
def self.create customer, listener = {}
c = CreateCustomer.new(listener)
c.create(customer)
end
def initialize(listener)