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
# In your app class: | |
__PACKAGE__->config( | |
'Plugin::PrometheusTiny' => { | |
metrics => [ | |
{ | |
name => 'http_request_count_by_route', | |
help => 'HTTP request count by route', | |
type => 'counter', | |
}, |
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
validator( $params, $rules, @additional_args? ) | |
Where: | |
$params is a hash reference of parameters to be validated. | |
$rules is one of: | |
* the name of a rule sub if you are using "rules_class" | |
* the name of a rule file if you are using "rules_dir" |
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
=head3 Config becomes immutable | |
The plugin's C<config> attribute is loaded lazily on the first call to | |
C<config>. After this first call C<config> becomes immutable so you cannot | |
do the following in a test: | |
use Dancer2; | |
use Dancer2::Plugin::FooBar; | |
set plugins => { |
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
#!/bin/bash | |
exec 2>&1 | |
#set -e | |
set -x | |
export PATH="/usr/bin:/usr/sbin..:/bin:/usr/sbin:/usr/local/bin" | |
COVER_PERL="perl-5.20.3" | |
source /smoker/.bash_profile |
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
# configuration file for development environment | |
paypal: | |
id: <praypalid> | |
password: <pwd> | |
signature: <sig> | |
sandbox: 1 | |
returnurl: https://<yourdomain>/paypal/getrequest | |
cancelurl: https://<yourdomain>/cart | |
currencycode: EUR |
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/env perl | |
use Plack::Builder; | |
use Plack::Middleware::Debug::DBIC::QueryLog; | |
use Plack::Middleware::DBIC::QueryLog; | |
use Dancer; | |
use Dancer::Plugin::DBIC; | |
use Dancer::Handler; | |
use lib 'lib'; | |
use DanceShop; |
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
SELECT "product"."sku", "product"."name", "product"."uri", "product"."price", | |
"product"."short_description", ( | |
SELECT COUNT( * ) | |
FROM "products" "variants_alias" | |
WHERE "variants_alias"."canonical_sku" = "product"."sku" | |
), COALESCE( ( | |
SELECT AVG( "message"."rating" ) | |
FROM "products" "canonical_alias" | |
JOIN "product_reviews" "_product_reviews" | |
ON "_product_reviews"."sku" = "canonical_alias"."sku" |
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 MidiPhotoBank::Photo; | |
use Cache::FileCache; | |
use Dancer ':syntax'; | |
use Dancer::Plugin::Database; | |
use File::Type; | |
use HTTP::Date qw(time2str); | |
use Imager; | |
our $VERSION = '0.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
SELECT "product"."sku", "product"."name", "product"."uri", "product"."price", "product"."short_description", | |
CASE WHEN COUNT( variants.sku ) > 0 THEN 1 ELSE 0 END, | |
CASE WHEN COUNT( variants.sku ) > 0 | |
THEN | |
CASE WHEN COALESCE( MIN( current_price_modifiers_2.price ), MIN( variants.price ) ) < MIN( variants.price ) | |
THEN COALESCE( MIN( current_price_modifiers_2.price ), MIN( variants.price ) ) | |
ELSE MIN( variants.price ) | |
END | |
ELSE COALESCE( MIN( current_price_modifiers.price ), product.price ) | |
END AS selling_price, |
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/env perl | |
use Plack::Builder; | |
use Plack::Middleware::Debug::DBIC::QueryLog; | |
use Plack::Middleware::DBIC::QueryLog; | |
use Dancer; | |
use Dancer::Plugin::DBIC; | |
use Dancer::Handler; | |
use lib 'lib'; | |
use DanceShop; |
NewerOlder