Skip to content

Instantly share code, notes, and snippets.

View ilmari's full-sized avatar

Dagfinn Ilmari Mannsåker ilmari

View GitHub Profile
@ilmari
ilmari / body.json
Last active May 29, 2019 20:00
dists with inc/Module/Install.pm
{
"query": {
"match_all": {}
},
"filter": {
"and": [
{
"term": {
"path": "inc/Module/Install.pm"
}
@ilmari
ilmari / moar.magic
Created January 12, 2016 16:53
Draft MoarVM magic(5) file
0 string MOARVM\r\n MoarVM bytecode
>8 lelong 5 (version %u)
>>16 lelong x \b, %u serialization contexts
>>24 lelong x \b, %u extension ops
>>32 lelong x \b, %u frames
>>40 lelong x \b, %u callsites
>>48 lelong x \b, %u strings
>>56 lelong x \b, %u bytes serialized data
>>(52.l) lelong x (version %u)
>>64 lelong x \b, %u bytes bytecode
(defface nbsp-space
'((t (:foreground "green" :bold t)))
"Used for displaying the nbsp character")
(if standard-display-table
()
(setq standard-display-table (make-display-table)))
(aset standard-display-table
(make-char 'latin-iso8859-1 (- ?\240 128))
@ilmari
ilmari / loaded.pm
Last active December 31, 2015 01:59 — forked from arodland/loaded.pm
package if::loaded;
use Module::Runtime qw(module_notional_filename use_module);
sub work {
my $method = shift() ? 'import' : 'unimport';
my %args = map { $_ => [] } qw(try else args);
my $arg = 'try';
for (@_) {
if (/\A-(.*)\z/) {
@ilmari
ilmari / ubsan.all.uniq
Last active December 17, 2015 21:28
MoarVM UBSAN errors from NQP Configure + make + make test
3rdparty/dynasm/dasm_x86.h:391:23: runtime error: store to misaligned address 0xdeadbeef for type 'unsigned int', which requires 4 byte alignment
3rdparty/dynasm/dasm_x86.h:393:19: runtime error: store to misaligned address 0xdeadbeef for type 'short unsigned int', which requires 2 byte alignment
src/6model/reprs/MVMStaticFrame.c:113:5: runtime error: null pointer passed as argument 2, which is declared to never be null
src/6model/reprs/MVMStaticFrame.c:62:9: runtime error: null pointer passed as argument 2, which is declared to never be null
src/6model/reprs/P6bigint.c:95:20: runtime error: negation of -9223372036854775808 cannot be represented in type 'long int'; cast to an unsigned type to negate this value to itself
src/6model/serialization.c:1581:21: runtime error: left shift of 4861 by 52 places cannot be represented in type 'long int'
src/6model/serialization.c:1581:21: runtime error: left shift of 4871 by 52 places cannot be represented in type 'long int'
src/6model/serialization.c:2297:50: runtime er
package MySchema;
use strict;
use warnings;
use parent qw(DBIx::Class::Schema);
__PACKAGE__->load_namespaces;
1;
@ilmari
ilmari / nopaste.txt
Created December 13, 2012 17:39
suggested ternary wrapping
my %types = map {
my $t = defined($params->{"${_}_type"}) ? $params->{"${_}_type"}
: is_blessed($params->{$_}) ? $params->{$_}->item_type
: defined($params->{$_}) && @{$params->{$_}} ? $params->{$_}->[0]->item_type
: undef;
defined($t) ? ($_ => $t) : ()
} qw(container containee);
#!/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
# 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',
}
## 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