Skip to content

Instantly share code, notes, and snippets.

View ilmari's full-sized avatar

Dagfinn Ilmari Mannsåker ilmari

View GitHub Profile
mysql> select name from school_region where name != '' order by name;
+------------------+
| name |
+------------------+
| East |
| East Midlands |
| London |
| North East |
| North West |
| Northern Ireland |
@ilmari
ilmari / config.yml
Created September 2, 2011 16:08
Config merge problem
plugins:
DBIC:
Foo:
schema_class: "MyApp::Schema"
options:
mysql_enable_utf8: 1
on_connect_call:
- "set_strict_mode"
OtherPlugin:
some_setting: bar
#!perl
use Test::More;
use Test::Fatal;
use MooseX::Types::Moose qw(ArrayRef HashRef Value);
use MooseX::Types -declare => [
qw(StructHash StructArray Struct)
];
#!perl
use Test::More;
use Test::Fatal;
use MooseX::Types::Moose qw(ArrayRef HashRef Value);
use MooseX::Types -declare => [
qw(StructHash StructArray Struct)
];
$ +{ count_by { $_->status } grep { $_->server_id < 10**7 } @orders }
$HASH1 = {
cancelled => 2,
despatched => 5,
packed => 4,
partial => 20,
pending => 1,
printing => 337
};
diff --git a/lib/HTML/FormHandler/Widget/Field/Select.pm b/lib/HTML/FormHandler/Widget/Field/Select.pm
index fe990df..c63cf43 100644
--- a/lib/HTML/FormHandler/Widget/Field/Select.pm
+++ b/lib/HTML/FormHandler/Widget/Field/Select.pm
@@ -45,7 +45,6 @@ sub render {
$output .= ' selected="selected"';
}
}
- $output .= $ele_attributes;
my $label = $option->{label};
@ilmari
ilmari / gist:2911517
Created June 11, 2012 17:41
IE VM script
#!/bin/sh
case "$1" in
''|9) n=107;;
9v) n=106;;
8) n=105;;
7) n=104;;
*) echo 'Usage: ie [9|9v|8|7]' 2>&1; exit 1;;
esac
UPDATE node_items
SET payload = $5
FROM nodes
JOIN users ON (users.user_id = nodes.node_id)
JOIN hosts ON (hosts.host_id = users.host_id)
WHERE
hosts.name = $1 AND
users.id = $2 AND
nodes.name = $3 AND
node_items.node_id = nodes.id AND
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirror.rackspace.com/ubuntu/ oneiric-updates main restricted
deb-src http://mirror.rackspace.com/ubuntu/ oneiric-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirror.rackspace.com/ubuntu/ oneiric universe
deb-src http://mirror.rackspace.com/ubuntu/ oneiric universe
# Financial Reconcilation node for EC2.
node /^recon[\-a-z0-9]*\.photobox\.com$/ inherits babelnode {
$sitename = 'ec2_eu_west1'
# Set up site-specific configuration, including the correct timezone.
class { 'sites':
photobox_repo => 'stable',
stage => 'pre',
}