Skip to content

Instantly share code, notes, and snippets.

@masak
masak / explanation.md
Last active April 11, 2024 02:50
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@masak
masak / thought-experiment.md
Created October 17, 2012 15:21
Extending a vim editor with native Git functionality

This is a thought experiment, but one I've wanted to try for a long time.

  • Start with an editor that does everything vim does.
  • Remove the ability to load and save files.
  • From now on, all operations happen directly on a repository. You don't save a file, you stage changes. Or stash them. Any save-like operation takes place through git.

There are five views: edit file, status, diff, log, and merge file.

Edit file

$ ./yapsi --target=sic -e 'my $a = 3; while --$a { say my $b; say $a; $b = 42 }'
== BEFORE
This is SIC v2010.07
environment:
main:
$a: {"n" => 0, "type" => "container"}
main_1:

Hi,

We (jnthn + masak) met to discuss the next event, and came up with some ideas. We came up with one talk that we'd give jointly, 2 proposals for masak to give, and 3 proposals for jnthn to give. From here, it depends on how many slots we have; if we were to have 5 slots, then the joint one plus masak's two and the choice of 2 out of the 3 suggested for jnthn would work. If we are going to have a guy come along and do a couple of JavaScript ones, that'd take us up to 7 sessions, which is enough for an event. :-)

Anyway, here's the ideas.

Git for the Enterprise

Presented jointly by Carl Mäsak and Jonathan Worthington

@masak
masak / 01-stat
Created May 10, 2019 11:36
Playing around with generating data for box plots
$ cat stat
a249ded 68.390
a249ded 67.585
a249ded 66.976
a249ded 67.658
a249ded 66.592
a249ded 68.217
a249ded 67.328
a249ded 66.319
a249ded 68.024
= The "Perl 6 is not Perl" meme
<code>
&lt;emma&gt; Pardon me. Does perl6 have anything to do with perl? Are they two different languages?<br>
&lt;Tene&gt; Depends on how you look at it. ;)<br>
&lt;emma&gt; I was just told by the people in #perl that they are not the same language.<br>
&lt;Tene&gt; Perl 6 doesn't share any code with Perl 5. It's a complete reimplementation, break of compatibility, etc.<br>
&lt;emma&gt; I find this state of affairs needlessly confusing and if perl came first then naming your language perl6 is just rude.<br>
&lt;emma&gt; How would you like it if we made yet anther language called Perl6.0 just to confuse people and steal your success?<br>
&lt;jnthn&gt; emma: Larry Wall, who created Perl from version 1, is the creator of Perl 6.<br>
kaye:parrot masak$ perl Configure.pl
Parrot Version 0.4.13 Configure 2.0
Copyright (C) 2001-2007, The Perl Foundation.
Hello, I'm Configure. My job is to poke and prod your system to figure out
how to build Parrot. The process is completely automated, unless you passed in
the `--ask' flag on the command line, in which case it'll prompt you for a few
pieces of info.
Since you're running this program, you obviously have Perl 5--I'll be pulling
== How Perl 6 could kill us all!
People's minds weave stories. Stories weave people's minds.
My mind is pretty tied to the Perl 6 story nowadays, and I haven't minded the
Perl 5 story much. Until this week, that is. Last Sunday, I backlogged over a
discussion of someone coming in from #perl asking people on #perl6 why Perl 6
claimed to be Perl <a href='http://use.perl.org/~masak/journal/39861'>when it
clearly isn't</a>. My resulting blog post basically asked the #perl people to
stop telling outsiders biased things.
@masak
masak / pack-unpack.md
Created September 24, 2011 10:58
A first approach to pack/unpack in Perl 6

Here is the difference between Perl 5 and Perl 6 pack/unpack:

Perl 5                      Perl 6

pack(List)  --> Str         pack(List)  --> Buf
unpack(Str) --> List        unpack(Buf) --> List

Not only that, but some Perl 5 template rules assume an uncomplicated two-way street between Buf and Str. There simply is no real distinction in Perl 5 between Buf and Str, and Perl 5 makes use of that quite a bit.

Just looking at the description of the first template rule gives an indication of this:

@masak
masak / description.txt
Last active January 10, 2019 15:06
objects and operations in Dark needed for my blog
Pipe (for example set, convert, publish, take)
---- \ ----
---- \ ----
---- / ----
---- / ----
Funnel (for example aggregate)
---- \