Skip to content

Instantly share code, notes, and snippets.

// Not correct (last label in bad location) - but useful for reference
var prices = [
'175',
'250',
'350',
'500',
'700',
'1000',
// factory and fu are helper classes
show_list({
title: 'Max price',
key: 'price_to',
view: view_price_options,
list: list,
is_price : true,
left: factory.total_width() - 130
});
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
#!/usr/bin/env perl
use strict;
use warnings;
use lib qw(lib);
use Plack::App::Cascade;
use Plack::Builder;
use Plack::Middleware::Static;
use Plack::Middleware::ErrorDocument;
use Plack::App::TemplateToolkit;
@ranguard
ranguard / gist:802724
Created January 30, 2011 09:43
Error Document not working....
#!/usr/bin/env perl
use strict;
use warnings;
use lib qw(lib);
use Plack::App::Cascade;
use Plack::Builder;
use Plack::Middleware::Static;
use Plack::Middleware::ErrorDocument;
use Plack::App::TemplateToolkit;
@ranguard
ranguard / gist:950625
Created May 1, 2011 16:34
Deploying to DotCloud
sudo easy_install dotcloud
dotcloud create leotest
dotcloud deploy --type perl leotest.www
git://github.com/ranguard/plack-example.git
cd plack-example/multiple_roots/
dotcloud push leotest.www ./
open http://www.leotest.dotcloud.com/
@ranguard
ranguard / gitalist_app
Created May 20, 2011 15:02
Gitalist app.psgi example
#!/usr/bin/env perl
use strict;
BEGIN {
# directory containing clones
$ENV{GITALIST_REPO_DIR} = "./";
}
use Gitalist;
@ranguard
ranguard / gist:1198565
Created September 6, 2011 18:41
Nasty global variables
#!/usr/bin/perl
package mytest;
our $global_var = "hello \n";
sub print_global_var {
print $global_var ."\n";
}
package main;
# Send an email
use Email::Sender::Simple qw(sendmail);
use Email::Simple;
use Email::Simple::Creator;
my $email = Email::Simple->create(
header => [
To => '"Xavier Q. Ample" <[email protected]>',
From => '"Bob Fishman" <[email protected]>',
Subject => "don't forget to *enjoy the sauce*",