156 karma · joined March 19, 2017
That said, x220s and x230s seem to have gotten more expensive since then, I haven't seen any similarly good deals lately.
I should probably add a check for catching someone within the sudo timeout and give them a hard time if so.
They're also each a dollar to unlock voiced/combined readings and remove ads. My pihole did block the ads while I was just trying them out.
*Except for the "unless they don't want to receive files from you" part.
docker run -itv /:/host ubuntu chroot /hostHe's the sort to dig as far into the internals of things as he can and then start messing with it (he implemented partial function application for C, for example [1]).
My poor prototypes never stood a chance.
That said, I've had caps lock bound to backspace for years, so I'm not advocating for something I do myself.
MAIN is probably what I should point to as P6's killer feature for things of this scope. I tend to get sidetracked by math/functional features when I demo things even though stuff like this is a bit more practical and likely to get traction.
I just got around to cleaning up that tmux wrapper I mentioned above (https://gitlab.com/0xFORDCOMMA/sessions) and that might be worth writing something about. It's a miniscule project, but I think it highlights a lot of useful features.
One result of that clean-up that relates to this is the new usage output. It's still automatically generated [1], but adding purpose annotations to the multi-dispatch MAINs in `session` and using a P6 enum as a type constraint in the MAIN in `sessions` resulted in what I consider quite useful documentation pretty much for free.
λ | -> session --usage
Usage:
session -- Create or enter default session 'misc/dev'.
session <category> <session> -- Create or enter session '<category>/<session>'.
session <session> -- Search all categories for matching session, switch to result if unique.
λ | -> sessions --usage
Usage:
sessions [--style=<Style> (boxed compact)] -- Default display style is boxed.
The latter example is generated entirely from these two declarations: enum Style <boxed compact>;
#|(Default display style is boxed.)
sub MAIN(Style :$style = boxed) { ... }
[1] For anyone interested, you can have your cake and eat it too. Defining your own USAGE routine doesn't mean you have to give up the generated one. The generated output is available in the $*USAGE variable.I use P6 for all of my small deployment scripts (as well as a number of small utilities I've written, like a tmux wrapper). It gets out of my way when I just need something quick and useful from the start. For example it's exceedingly easy to wrap other utilities because arguments to MAIN generate a command line interface automatically.
It also provides features that help me as I move from a useful-but-dirty prototype to a more maintainable script or piece of a more complex system. Gradual typing is a big part of this. I tend not to add types for most things, but it's very easy to use the P6 type system to watch my back when I do want that help. It's not as good at catching things before runtime as a hardcore static type system, but it manages to warn me "... will never succeed with declared signature ..." often enough.
I have a no-frills, no-auth file sharing site I deploy periodically to get a web front-end to share things with people (usually already on a VPN, sometimes just on a LAN). At the moment, I use a simple deploy script to do this manually, but I'm considering setting something up to automatically deploy it when connecting to a particular network. I almost definitely won't get that part right on the first try and would really rather not end up accidentally deploying a no-auth filesystem on my server's public IP address.
Using the P6 type system, I can easily define a subset of IPv4 addresses:
my @private-ranges = <10.0.0.0/8 172.16.0.0/12 192.168.0.0/16>;
subset IPv4::Private of IPv4 where -> $ip { Net::Netmask.new(any @private-ranges).match($ip) };
Then simply defining MAIN with a typed (and named, in this case, hence the colon) argument will handle all the checking at the type level. sub MAIN(IPv4::Private :$ip) { ... }
Now I won't be able to deploy this service on a public IP as long as I use this deploy script as a primitive in whatever eventual solution I end up with, and the automatically generated usage message even helps communicate why a call failed (provided you have descriptive type/parameter names). λ | ./deploy --ip=$(dig +short myip.opendns.com @resolver1.opendns.com)
Usage:
./deploy.p6 [--ip=<Private>]
λ | ./deploy --ip=10.0.0.2
Deploy successful.This has never been an actual issue (or even commented on), but another middle name discrepancy has. Back in high school, there were some issues with my name on my state ID not exactly matching the school's entry for me.
Having to go even further than that and use shades of the colors I do have trouble with would be far more onerous.
On planes it's simpler than pausing/removing the headphones to order a drink and the same in the office when you just need a quick yes/no from someone next to you.
There's also a passive mode I use when I'm actually outside with the headphones on. You don't hear engine noise or planes overhead but you can still hear tire noise of nearby cars so you don't get run over. If it's quiet you even hear footsteps.
The only related issue for me recently was a failure to restore a session after Firefox forced a restart for an update. That's the behavior that chases me back to Brave on other systems (where it's not as easy to `tabs.sh > current_tabs` just in case).
Edit: To add on to this, ZFS doesn't do parity-based repair at the checksum level. In the mentioned case (good data, bad checksum) no copy of the block will match the checksum and there will be no supposedly-good block to copy over.
There is! With a programmable (preferably grid-layout) keyboard, you can have a numpad accessible from the homerow.
Edit: I do realize this can be inconvenient at times, but I primarily use an external keyboard with my laptop.
It's recently escalated to sudolphin-ing (think a sudo alias involving cowsay and you're on the right track).