Skip to content

Instantly share code, notes, and snippets.

View phillipadsmith's full-sized avatar

Phillip Smith phillipadsmith

View GitHub Profile
@phillipadsmith
phillipadsmith / gist:1132562
Created August 8, 2011 19:56
Install PSGI
$ cpan Catalyst::Engine::PSGI
$ script/catalystcloud_create.pl PSGI
$ ln -s script/catalystcloud.psgi app.psgi
@phillipadsmith
phillipadsmith / dotcloud.yml
Created August 8, 2011 19:57
dotCloud YAML file
www:
type: perl
@phillipadsmith
phillipadsmith / gist:1132569
Created August 8, 2011 19:58
Catalyst app directory layout
Changes Makefile.PL blib/ inc/ script/
META.yml README catalyst_default.conf lib/ static@
Makefile app.psgi@ dotcloud.yml root/ t/
@phillipadsmith
phillipadsmith / gist:1132570
Created August 8, 2011 19:58
dotCloud parses Makefile.PL and builds dependancies
2011-08-08 13:38:30 [www.0] Configuring Catalyst-Default-0.01 ... OK
2011-08-08 13:38:30 [www.0] ==> Found dependencies: namespace::autoclean, Catalyst::Plugin::Static::Simple, Catalyst::Plugin::ConfigLoader, Catalyst::Action::RenderView, Config::General, Catalyst::Runtime, Catalyst::Engine::PSGI, Moose
... lots more output ...
@phillipadsmith
phillipadsmith / gist:1132572
Created August 8, 2011 19:58
dotCloud finishes the build and deploys the app
Deployment finished. Your application is available at the following URLs
www: http://9f385357.dotcloud.com/
@phillipadsmith
phillipadsmith / gist:1147843
Created August 15, 2011 20:58
Default::Catalyst - create DB model
./script/catalyst_default_create.pl model DB DBIC::Schema Catalyst::Default::Schema create=static 'dbi:Pg:dbname=default-catalyst' '**********' '***********' '{ AutoCommit => 1 }'
dotcloud info catalyst.data
cluster: wolverine
config:
postgresql_password: **********
created_at: 1313444468.2643919
ports:
- name: ssh
url: ...
- name: sql
url: ...
@phillipadsmith
phillipadsmith / gist:1148393
Created August 16, 2011 03:35
Catalyst::Default - Application directory layout
Changes README environment.json root/
META.yml app.psgi@ inc/ script/
Makefile catalyst_default.conf lib/ static@
Makefile.PL dotcloud.yml myapp01_psql.sql t/
@phillipadsmith
phillipadsmith / gist:1148397
Created August 16, 2011 03:37
Catalyst::Default - local environment file
{
"DOTCLOUD_DATA_SQL_PASSWORD": "catalyst",
"DOTCLOUD_DATA_SQL_HOST": "localhost",
"DOTCLOUD_DATA_SQL_LOGIN": "catalyst",
"DOTCLOUD_DATA_SQL_PORT": "5432"
}
@phillipadsmith
phillipadsmith / mod_rewrite_rules
Created November 22, 2011 21:12
Mobile site redirection using mod_rewrite
RewriteEngine On
# If the user is asking for the fullsite, set a cookie, remove the query, and stop.
RewriteCond %{QUERY_STRING} ^fullsite$
RewriteRule ^/?(.*)$ http://domain.com/$1? [L,CO=fullsite:yes:.domain.com]
# If the user is asking for the mobilesite, set a cookie, remove the query, redirect and stop.
RewriteCond %{QUERY_STRING} ^mobilesite$
RewriteRule ^/?(.*)$ http://m.domain.com/$1? [L,CO=fullsite:no:.domain.com]