I hereby claim:
- I am amarnus on github.
- I am amarnus (https://keybase.io/amarnus) on keybase.
- I have a public key whose fingerprint is 4884 1418 B4B9 7CDF 1C81 CD4C 892F 1E8C BCBF 961D
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env perl | |
use Carp::Assert; | |
sub extractOne { | |
return 3 - 2; | |
} | |
sub returnOne { | |
my $one = 0; |
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use MongoDB; | |
use Tie::IxHash; | |
my $client = MongoDB::MongoClient->new; | |
my $database = $client->get_database( 'sorty' ); |
Use brew
to install the ModSecurity Apache module.
brew install homebrew/apache/mod_security
Ask Apache to load the module by editing the configuration file (at /etc/apache2/httpd.conf
). Under the long list of LoadModule
statements, add:
LoadModule security2_module /usr/local/Cellar/mod_security/2.7.7/libexec/mod_security2.so
While you are at it, load the mod_unique_id
module as well. This is required by ModSecurity. Do so by uncommenting the line:
To run this example, you need to have Mojolicious and MojoX::Redis installed.
cpanm Mojolicious
cpanm --force MojoX::Redis
To run the app,
morbo app.pl
To run the tests,
#!/usr/bin/env perl | |
# A way to do s/<find>/<replace>/s when you have both the <find> regex and the | |
# <replace> expression as variables. | |
use strict; | |
use warnings; | |
use 5.14.0; | |
sub transform { |
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Mojolicious::Lite; | |
my $app = app->start; | |
# When I go this page, I'd ideally want to see a HTTP 401 with an empty body. |
<?php | |
$variable = 'Overriding value set by requiree.'; | |
global $variable2; | |
$variable2 = 'New global variable set by requiree.'; |
<?php | |
define('BROWSER_LINE_SEPARATOR', '<br>'); | |
define('CLI_LINE_SEPARATOR', "\n"); | |
$separator = (php_sapi_name() == 'cli') ? CLI_LINE_SEPARATOR : BROWSER_LINE_SEPARATOR; | |
// A factory method that returns a object that can be mutated by the caller. | |
// The mutations are persisted across different calls to the function. | |
function factory1() { |
<?php | |
// Fetch data from the database | |
function my_mod_fetch_from_db() { | |
// Remember the number of dimensions of the static cache depends | |
// on the number of parameters that this function can take. | |
$cache = &drupal_static(__FUNCTION__, array()); | |
// Static cache miss | |
if (empty($cache)) { | |
// Check persistent cache |