Skip to content

Instantly share code, notes, and snippets.

View chartjes's full-sized avatar

Chris Hartjes chartjes

View GitHub Profile
@chartjes
chartjes / PHP 5.3.4 + PHP-FPM configuration
Created December 12, 2010 21:29
./configure statement I used
Configure Command => './configure' '--enable-fpm' '--with-zlib' '--with-curl' '--with-pdo-mysql=/usr/local' '--with-pdo-pgsql=/Library/PostgreSQL/9.0' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-pear=/usr/local'
@chartjes
chartjes / mock-testing-webservices.php
Created May 2, 2011 20:24
Mock-testing web services in Zend Framework
public function testGetTracks()
{
// Create mocks for the SoundCloud class for testing purposes
$webservice = $this->getMockBuilder('\Soundcloud\Services\Soundcloud')
->setConstructorArgs(array(
$this->config->soundcloud->clientId,
$this->config->soundcloud->clientSecret))
->setMethods(array('get', 'setAccessToken'))
->getMock();
$myInfo = file_get_contents(FIXTURE_PATH . '/soundcloud_my_info.txt');
@chartjes
chartjes / gist:1136080
Created August 10, 2011 03:40
Sample Djano template using HAML
%head
%meta{'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8'}
%title Internet Baseball League
%link{'rel': 'stylesheet', 'type': 'text/css', 'href':'/site_media/css/grid.css'}
%link{'rel': 'stylesheet', 'type': 'text/css', 'href':'/site_media/css/ibl.css'}
%script{'src': "/site_media/js/modernizr-1.7.min.js"}
%body
%div{'class': 'row'}
#sidebar{'class': 'column grid_2'}
%img{'src': '/site_media/images/ibl_logo.gif', 'alt': 'IBL Logo'}<br>
@chartjes
chartjes / gist:1203418
Created September 8, 2011 13:43
Stack trace from 'rake generate'
-> % rake generate
## Generating Site with Jekyll
Configuration from /Users/chartjes/Sites/atthekeyboard/_config.yml
/Users/chartjes/Sites/atthekeyboard/plugins/category_generator.rb:73: warning: regexp has invalid interval
/Users/chartjes/Sites/atthekeyboard/plugins/category_generator.rb:73: warning: regexp has `}' without escape
/Users/chartjes/Sites/atthekeyboard/plugins/category_generator.rb:110: warning: regexp has invalid interval
/Users/chartjes/Sites/atthekeyboard/plugins/category_generator.rb:110: warning: regexp has `}' without escape
unchanged sass/screen.scss
./plugins/backtick_code_block.rb:5: warning: already initialized constant AllOptions
./plugins/backtick_code_block.rb:6: warning: already initialized constant LangCaption
> % rvm info
system:
system:
uname: "Darwin yggdrasil.local 11.1.0 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
zsh: "/usr/local/bin/zsh => zsh 4.3.12 (i386-apple-darwin10.8.0)"
rvm:
-> % rvm info
system:
system:
uname: "Darwin yggdrasil.local 11.1.0 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
zsh: "/usr/local/bin/zsh => zsh 4.3.12 (i386-apple-darwin10.8.0)"
rvm:
-> % rvm info
ruby-1.9.2-p290:
system:
uname: "Darwin yggdrasil.local 11.1.0 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
zsh: "/usr/local/bin/zsh => zsh 4.3.12 (i386-apple-darwin10.8.0)"
rvm:
-> % rake generate
## Generating Site with Jekyll
/Users/chartjes/.rvm/gems/ruby-1.9.2-p290/gems/posix-spawn-0.3.6/lib/posix_spawn_ext.bundle: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]
-- control frame ----------
c:0020 p:-17567061774494 s:0070 b:0070 l:000069 d:000069 TOP
c:0019 p:---- s:0068 b:0068 l:000067 d:000067 CFUNC :require
c:0018 p:0025 s:0064 b:0064 l:000063 d:000063 TOP /Users/chartjes/.rvm/gems/ruby-1.9.2-p290/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:2
c:0017 p:---- s:0062 b:0062 l:000061 d:000061 FINISH
rake clean # Clean out caches: _code_cache, _gist_cache, .sass-cache
rake config_deploy[branch] # Setup _deploy folder and deploy branch
rake copydot # copy dot files for deployment
rake deploy # Default deploy task
rake generate # Generate jekyll site
rake install[theme] # Initial setup for Octopress: copies the default theme into the path of Jekyll's generator.
rake integrate # Move all stashed posts back into the posts directory, ready for site generation.
rake isolate[filename] # Move all other posts than the one currently being worked on to a temporary stash location (stash) so regenerating the site happens much quicker.
rake list # list tasks
rake new_page[filename] # Create a new page in source/(filename)/index.markdown
-> % rake generate
## Generating Site with Jekyll
/Users/chartjes/.rvm/gems/ruby-1.9.2-p290/gems/posix-spawn-0.3.6/lib/posix_spawn_ext.bundle: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]
-- control frame ----------
c:0020 p:-17546208307864 s:0070 b:0070 l:000069 d:000069 TOP
c:0019 p:---- s:0068 b:0068 l:000067 d:000067 CFUNC :require
c:0018 p:0025 s:0064 b:0064 l:000063 d:000063 TOP /Users/chartjes/.rvm/gems/ruby-1.9.2-p290/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:2
c:0017 p:---- s:0062 b:0062 l:000061 d:000061 FINISH