Skip to content

Instantly share code, notes, and snippets.

View ajs's full-sized avatar

Aaron Sherman ajs

View GitHub Profile
@ajs
ajs / main.p6
Created December 7, 2018 19:57
Perl 6 Simple String Parser Example
# Perl 6 Example from: https://examples.perl6.org/categories/parsers/SimpleStrings.html
# 6pad-ified
# Note: Until this issue is fixed:
# https://github.com/perl6/6pad/issues/2
# You must reload this 6pad between runs, otherwise the
# grammar conflicts with itself as a redefinition.
use v6;
@ajs
ajs / perl6-python-lessons.md
Last active June 3, 2019 14:00
Things I think Python should learn from Perl 6

Some lessons I think Python should learn from Perl 6

I'm not going to wax poetic. I'm a professional Python programmer who has worked with the language for about 10 years and a former Perl 5 developer who also worked with the developers of Perl 6 for a few years.

I have no illusions about Perl 5's ... age, let's say. It was a solid tool for the day, but Python aged well and Perl 5 did not. Perl 6, on the other hand... well, it's a bag of tricks, and not all of those tricks are ones you want played on you. But, I think there are lessons here. Let's get to them.

First the non-lessons

@ajs
ajs / Numericish.pm6
Last active July 23, 2019 03:24
Numericish.pm6
use MONKEY;
role Numericish [::Basis] does Numeric is export {
has Basis $.value;
method new(Basis $value) { self.bless :$value, |%_ }
multi method gist() { "{self.WHAT.perl}({self.value})" }
my @overrides = <
Bool Complex DUMP FatRat Int Num Rat Real Str abs acos
@ajs
ajs / ajs_dfhack_sheet.md
Last active April 20, 2024 23:46
Dwarf Fortress DFHack and Tips Cheat Sheet

Info

This document pertains to the free version of Dwarf Fortress with DFHack. These commands will not work in the Steam version (yet!)

Useful DFHack Commands

Movement speed

@ajs
ajs / mj_cheat_sheet.md
Last active June 3, 2024 10:14
Midjourney Cheat Sheet

A Cheat Sheet of Midjourney control phrases

[descriptions based on v4]

  • fine ultra-detailed realistic - Can be a bit grainy and "ropey" but increases detail generation
  • ultra photorealistic - Simiar to "fine ultra-detailed realistic"
  • Hasselblad H6D - Sharper focus on subect; shadows are deepened
  • high definition - Shadows are lightened; more fanciful and saturated colors
  • 8k - Lighting tends to be more extreme; colors even more saturated and computer-generated looking than "high definition"
  • cinematic - Shadows tend to be more extreme (though not darker); objects a bit thicker; more poster-like
[
{
"amount_left" : 5,
"amount_total" : 5,
"frequency" : "Daily",
"id" : 46,
"is_active" : false,
"is_validated" : true,
"item_conditions" :
[