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
#!/usr/bin/perl -w | |
use strict; | |
use CGI qw(:all); | |
use CGI::Carp qw(fatalsToBrowser); | |
my($requested_color, $old_color, $color_cookie) = ("",""); | |
$old_color="blue"; # Default value | |
# Is there a new color requested? | |
if(defined param('color')) { | |
$requested_color = param('color'); | |
} |
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 RomanConverter; | |
use Moose; | |
use POSIX qw(floor); | |
use String::Util qw(trim); | |
use v5.10; | |
has 'NUMBERS_TO_ROMANS' => ( | |
is => 'bare' , | |
isa => 'Tree' , | |
weak_ref => 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
for my $method (qw(build_date bought_date)) { | |
Sub::Install::install($_ => sub { | |
my ($self, $input_arg) = @_; | |
return format_string($self->$method); | |
}); | |
} | |
sub apejens {} |
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
########################### config yml ########################### | |
--- | |
name: SearchResponsive::EchoSlam | |
EchoSlam: | |
my_config: | |
channel_name: 'my_config_yml_channel' | |
########################### model ########################### | |
package SearchResponsive::EchoSlam; | |
use Moose; |
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
# ------------- using * --------------------- | |
POST /logstash-*/_search | |
{ | |
"query": { | |
"filtered": { | |
"query": { | |
"match_phrase": { | |
"@fields.request": "/sok/google" | |
} | |
}, |
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
# this example based on module to do html/text truncate | |
# the Template plugin package | |
package Template::Plugin::TextTruncater; | |
use warnings; | |
use strict; | |
use utf8; | |
use DateTime; |
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
<!-- 1. first create the menu list --> | |
<ul class="my-menu"> | |
<li data-id="id-1" class="menu current"> | |
<a href="#">hello world 1</a> | |
</li> | |
<li data-id="id-2" class="menu"> | |
<a href="#">hello world 2</a> | |
</li> | |
<li data-id="id-3" class="menu"> | |
<a href="#">hello world 3</a> |
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
GET /stories/fairytale/_search | |
{ | |
"query": { | |
"filtered": { | |
"query": { | |
"match_all": {} | |
}, | |
"filter": { | |
"or": [ | |
{ |
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
# 1. first install module Catalyst::View::Email::Template, Catalyst::View::Email | |
# 2. create email template view | |
# 3. in config add these | |
View::Email::Template: | |
template_prefix: email | |
default: | |
view: HTML | |
content_type: text/html |
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
<?php | |
/**** | |
* PHP proxy for using the Bing Search API with AJAX | |
*/ | |
$acctKey = 'xxx'; |
OlderNewer