This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package WhatIf; | |
use base 'Squatting'; | |
# Data in %state persists between requests. | |
our %state; | |
sub service { | |
my ($app, $c, @args) = @_; | |
my $cr = $c->cr; | |
my $sid = $cr->{session_id}; | |
if (defined $sid) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package JGirl; # jgirl.com (after being liberated from domain squatters) | |
# | |
use strict; # Oh, the irony! | |
use warnings; #' | |
use base 'Squatting'; # <-----------------------------------' | |
use Encode; | |
our %CONFIG = ( | |
dbconnect => 'dbi:SQLite:dbname=jgirl.db', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (doc) { | |
// subset that doesn't contain current | |
var others = function(tags, current, length) { | |
var notCurrent = function(x) { return x != current; }; | |
if (length == 2) { | |
return tags.filter(notCurrent).map(function(n){ return [n] }); | |
} else { | |
var _others = []; | |
var list = tags.filter(notCurrent); | |
var size = length - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package CouchWiki; | |
use strict; | |
use warnings; | |
use base 'Squatting'; | |
use Coro::AnyEvent; | |
our %CONFIG = ( | |
db => 'couchwiki' | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package App; | |
use base 'Squatting'; | |
use Coro::AnyEvent; ### <<< --- very important XXX XXX XXX | |
our %CONFIG = ( | |
host => 'http://localhost:5984/', | |
db => 'app', | |
); | |
package App::Controllers; | |
use Squatting ':controllers'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package UTF8; | |
use base 'Squatting'; | |
# == How to Run This App == | |
# | |
# squatting UTF8 | |
# squatting UTF8 -c view=raw | |
# squatting UTF8 -c view=as_subs | |
# | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Chat; | |
use base 'Squatting'; | |
use AnyEvent; | |
use Coro; | |
use Coro::AnyEvent; | |
use Coro::Signal; | |
# a slot-based object WITHOUT prototype-based inheritance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Squatting::Controller; | |
sub new{bless{name=>$_[1],urls=>$_[2],@_[3..$#_]}=>$_[0]} | |
sub clone{bless{%{$_[0]},@_[1..$#_]}=> ref($_[0])} | |
for my$m qw(name urls cr env input cookies state v status headers log view app){ | |
*{$m}=sub:lvalue{$_[0]->{$m}}} | |
for my$m qw(get post head put delete options trace connect){ | |
*{$m}=sub{$_[0]->{$m}->(@_)}}sub param{my($self,$k,@v)=@_; | |
if(defined $k){if(@v){$self->input->{$k}=((@v>1)?\@v:$v[0]); | |
}else{$self->input->{$k}} | |
}else{keys%{$self->input}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -rN -u old-Continuity/lib/Continuity/Adapt/HttpDaemon.pm new-Continuity/lib/Continuity/Adapt/HttpDaemon.pm | |
--- old-Continuity/lib/Continuity/Adapt/HttpDaemon.pm 2008-12-10 15:20:22.000000000 -0800 | |
+++ new-Continuity/lib/Continuity/Adapt/HttpDaemon.pm 2008-12-10 15:20:22.000000000 -0800 | |
@@ -215,6 +215,8 @@ | |
sub debug_level { exists $_[1] ? $_[0]->{debug_level} = $_[1] : $_[0]->{debug_level} } | |
+sub debug_callback { exists $_[1] ? $_[0]->{debug_callback} = $_[1] : $_[0]->{debug_callback} } | |
+ | |
=for comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
090204 0:32:28 11 Connect kohaadmin@localhost on koha | |
11 Query set autocommit=1 | |
11 Query set NAMES 'utf8' | |
11 Query SELECT value | |
FROM systempreferences | |
WHERE variable='LibraryName' | |
LIMIT 1 | |
090204 0:32:29 11 Query select * from auth_types order by authtypetext | |
11 Query SELECT value | |
FROM systempreferences |
OlderNewer