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"
}
(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 / 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
@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
@ilmari
ilmari / output.txt
Created September 11, 2015 11:54
t/tester.t verbose failure
$ prove -e perl6 -lrv t/tester.t
t/tester.t ..
1..2
t/win.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.14 cusr 0.02 csys = 0.18 CPU)
Result: PASS
ok 1 - what should pass, passes
# Failed test at t/fail.t line 3
=head1 PSGI Middleware and the Future of Catalyst
The PSGI specification describes middleware as:
=over 4
"A middleware component takes another PSGI application and runs it. From the perspective of a server, a middleware component is a PSGI application. From the perspective of the application being run by the middleware component, the middleware is the server. Generally, this will be done in order to implement some sort of pre-processing on the PSGI environment hash or post-processing on the response."
=back

Keybase proof

I hereby claim:

  • I am ilmari on github.
  • I am ilmari (https://keybase.io/ilmari) on keybase.
  • I have a public key whose fingerprint is 1810 6714 A5F0 E9B4 11C0 7CA7 1065 888F D355 CB63

To claim this, I am signing this object:

@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/) {
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);