Skip to content

Instantly share code, notes, and snippets.

View amcgregor's full-sized avatar
🏢
Examining Options

Alice Zoë Bevan–McGregor amcgregor

🏢
Examining Options
View GitHub Profile
Faces...Faces...
Discovering the secret of human life may be the true path we should follow.
Faces, yes, human faces, appear different to you every time you look at them.
Our expressions are a separate matter, but I'm talking about a bigger picture.
We all have faces that are completely different from each other. So, where does
this diversity come from? Have you ever thought about it? Whether on the metro,
bus, ferry, or while watching a live music band, in short, at any corner of life,
I observe human faces. I see different expressions, different life experiences,
sorrows, joys, words of love, vows of commitment, the excitement of felt love—yes,
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@amcgregor
amcgregor / _Multiple File Upload Capture.md
Last active August 19, 2023 13:22
A sample application to try out capturing multi-file uploads with nested structures.

Create a new virtual environment somewhere you'd like to place these files.

python3.9 -m venv uploadtest
cd uploadtest
. bin/activate

Then drop these files in that directory. Install dependencies:

@Enichan
Enichan / interpretoy.html
Last active December 16, 2021 21:38
Interpretoy: a toy lisp interpreter with REPL built in javascript
<html>
<head>
<title>Interpretoy REPL</title>
</head>
<body>
<script>
// based on lispy by Peter Norvig: http://norvig.com/lispy.html
function load(source) {
@amcgregor
amcgregor / change-delay.js
Last active February 8, 2024 17:44
Currently untested ES6 notepad sketches of isolatable global behaviors.
{ // "Change delay" committal of altered form fields and editable content without waiting for blur.
function monitorTyping(
element,
initial = 1000, // Initial delay value of one second.
highlight = true, // When entering a field, select its contents.
minimum = 500, // Minimum wait time.
threshold = 2, // Don't bother if the field has fewer than this many characters.
forceable = true // Ignore threshold on blur and when pressing enter.
) {
var timeout,

Originally posted at https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/august/javascript-cryptography-considered-harmful/

Javascript Cryptography Considered Harmful

WHAT DO YOU MEAN, "JAVASCRIPT CRYPTOGRAPHY"?

We mean attempts to implement security features in browsers using cryptographic algoritms implemented in whole or in part in Javascript.

You may now be asking yourself, "What about Node.js? What about non-browser Javascript?". Non-browser Javascript cryptography is perilous, but not doomed. For the rest of this document, we're referring to browser Javascript when we discuss Javascript cryptography.

@amcgregor
amcgregor / ddelange-pip-constraints.md
Created July 28, 2021 04:50
Particularly interesting comment by ddelange on resolving Python packaging version complexity issues using pip's constraints functionality.

From: pypa/pip#9187 (comment)

could there be an easy option that forbides pip-21.2.1 to downgrade any already installed package (like specifying the existing packages version as a minimal constraint >= ) ?

@stonebig if you still have your pip cache populated, there is a way to achieve it without spamming the pypi registry: you can use the output of pip freeze and feed it to your pip command with an additional -r (it can be used multiple times):

pip freeze | sed 's/==/>=/' >> ./constraints.txt
pip install <some-new-package> -r ./constraints.txt
@amcgregor
amcgregor / 1-#webcore.log
Last active June 7, 2021 22:09
Goodbye Freenode. It was a mostly-fun 15 years.
# "Official services" forced out of channel, usurper joins and gains control.
[2021-05-25T23:04:14-0400] ChanServ (ChanServ@services.) left the channel
[2021-05-25T23:04:17-0400] freenodecom (~com@freenode/staff) joined the channel
[2021-05-25T23:04:17-0400] freenodecom sets mode +o freenodecom
[2021-05-25T23:04:17-0400] freenodecom changed the topic to This channel has moved to ##webcore. The topic is in violation of freenode policy: https://freenode.net/policies
[2021-05-25T23:04:17-0400] <@freenodecom> This channel has been reopened with respect to the communities and new users. The topic is in violation of freenode policy: https://freenode.net/policies
# All channel modes reset (bans, quiets, …)
[2021-05-25T23:04:17-0400] OperServ sets mode +o freenodecom
[2021-05-25T23:04:17-0400] ChanServ sets mode +imnpscf-bbb ##webcore *!*@*shell/* *!*@*.powered.by.lunarbnc.net $a:average

hi, and goodbye

The past few weeks has not been fun on IRC, the drama based on false information and assumptions has been insane. I've almost entirely been silent on the drama because I know the fallout that would happen if I spoke up.

A quick TLDR - I'm quitting all IRC development. KiwiIRC project lead, IRCv3 technical board, supporting the multitude of IRC networks, the lot.

Many people seem to think that I am supporting one side in everything that is going on, so just to be clear: I am not supporting any side of the current freenode drama - there is so much false information going around from everywhere that it is impossible to support anybody.

Woo freenode drama