This file contains hidden or 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
extend ThinkingSphinx::ActiveRecord::ClassMethods | |
class << self | |
attr_accessor :sphinx_index_blocks | |
def set_sphinx_primary_key(attribute) | |
@sphinx_primary_key_attribute = attribute | |
end | |
def primary_key_for_sphinx |
This file contains hidden or 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 Bot::BasicBot::Pluggable::Module::Infobot; | |
{ | |
$Bot::BasicBot::Pluggable::Module::Infobot::VERSION = '0.96'; | |
} | |
use strict; | |
use warnings; | |
use base qw(Bot::BasicBot::Pluggable::Module); | |
use Data::Dumper; | |
use LWP::UserAgent (); |
This file contains hidden or 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
--- Infobot.pm.orig 2012-03-18 09:13:26.000000000 -0700 | |
+++ Infobot.pm 2012-03-18 09:29:08.000000000 -0700 | |
@@ -14,6 +14,58 @@ | |
eval { require XML::Feed }; | |
our $HAS_XML_FEED = $@ ? 0 : 1; | |
+our %AUXILLARY_VERBS = ( | |
+ "am" => { tense => 'present' }, | |
+ "are" => { tense => 'present' }, | |
+ "aren't" => { tense => 'present', negative_of => "are" }, |
This file contains hidden or 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
% cat error.pl | |
use strict; | |
use Dancer; | |
get '/' => sub { | |
send_error('foo'); | |
}; | |
dance; |
This file contains hidden or 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
# HF2K Example | |
<!-- if $^r.uri !="/search/dir_ukie" && $|req[r] && $|req[y] == "n" --> | |
##redirect http://uk.search.yahoo.com/search/dir_ukie?$^r.args | |
exit | |
<!-- endif --> |
This file contains hidden or 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
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
use POE; | |
use POE::Component::IRC; | |
use IO::Handle; | |
open DEBUG, ">>slavorg.log" or die "Can't open log file: $!\n"; | |
DEBUG->autoflush(1); |
This file contains hidden or 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
sub vcl_recv { | |
if (req.http.Cookie ~ "mycookie=") { | |
# The request does have a tracking cookie so store it temporarily | |
set req.http.Tmp-Set-Cookie = req.http.Cookie; | |
unset req.http.Cookie; | |
} else { | |
# The request doesn't have a tracking cookie so force a miss | |
set req.hash_always_miss = true; | |
} |
This file contains hidden or 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 SchemaLoader; | |
use strict; | |
sub schema { | |
my $class = shift; | |
my $table = shift; | |
my $dbh = shift; | |
my $db_type = $dbh->{'Driver'}{'Name'} or die 'Cannot determine DBI type'; | |
my $sub = lc($db_type); |
This file contains hidden or 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
sub vcl_recv { | |
if (req.http.Cookie ~ "mycookie=") { | |
# The request does have a tracking cookie so store it temporarily | |
set req.http.Tmp-Set-Cookie = req.http.Cookie; | |
unset req.http.Cookie; | |
} else { | |
# The request doesn't have a tracking cookie so create one | |
set req.http.Tmp-Set-Cookie = if(req.http.Cookie, req.http.Cookie "; ", "") "mycookie=" digest.hash_md5(now randomstr(32) client.ip); | |
} | |
OlderNewer