Skip to content

Instantly share code, notes, and snippets.

View amcgregor's full-sized avatar
🏢
I died! …well, I got better…

Alice Zoë Bevan–McGregor amcgregor

🏢
I died! …well, I got better…
View GitHub Profile
@amcgregor
amcgregor / lolshadowbanned.md
Last active August 29, 2015 14:07
On how the “secretary of the office of the president” retained me as a Rogers client.

So your network doesn't support e-mail, eh?

On how the “secretary of the office of the president” retained me as a Rogers client.

I've been a long-long-long-time Rogers customer. Their support, for me, usually gets to the point not of desperation, but of joy. Admittedly it usually takes several attempts to reach someone who isn't a complete idiot reading from a script, but I've always been satisfied in the end. Satisfied enough to remain a customer, at least! This event in the mid 00's, though, taxed the limits I'm willing to reach for bad tech support while still managing to leave me as a customer. (Lesser of evils and whatnot.)

I'm a sysop. I need access to my boxen from anywhere and everywhere, and while GSM speeds are pretty suck compared to modern LTE it was more than enough for an SSH connection, or some light-weight HTTP or VNC/RDP over a VPN. The VPN turned out to be a sticking point, as no matter which technology (PPTP, L2TP/IPsec, etc.) I tried my phone would never connect and/or authent

@amcgregor
amcgregor / worker.py
Last active August 29, 2015 14:07
An operational RPC worker for MongoDB.
#!/usr/bin/env python
# coding: utf-8
"""MongoDB queue and RPC mechanism for remote deferred execution.
To get started with this, create a virtualenv:
virtualenv --python=python2.7 q
cd q
source bin/activate
# -*- coding: utf-8 -*-
"""
Base asset model from the original prototype of Contentment.
"""
import logging, re
from uuid import UUID, uuid4
@prwhite
prwhite / Makefile
Last active February 23, 2025 11:56
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@tonyseek
tonyseek / README.rst
Last active November 5, 2022 15:20
Build Python binding of C++ library with cffi (PyPy/Py3K compatible)

Run with Python:

pip-2.7 install cffi
PYTHON=python2.7 sh go.sh

Run with PyPy:

pip-pypy install cffi
PYTHON=pypy sh go.sh
@amcgregor
amcgregor / _laws.md
Last active February 3, 2022 22:42
Alice's Laws

Alice's Laws

  1. You can only count on yourself.
  2. Never reveal more than you have to.
  3. Execution is nine-tenths of the job.
  4. Give credit where credit is due.
  5. When all else fails, do it yourself.
  6. 90% of a project takes 90% of the time.
  7. The remaining 10% takes an additional 90% of the time.
  8. Never date a co-worker.
@amcgregor
amcgregor / 0-slide-content.textile
Created December 4, 2012 18:46
An overview of a light-weight, high-performance scalable deferred task (RPC) system.

MongoDB as RPC

  • Needed for timed game events.
  • Needed because Facebook’s API is slow.
  • Background task execution.
  • Immediate or scheduled.
  • Captures responses and exceptions.
  • Acts as a state machine with atomic locking.
    • Uses the “update if current” mechanism.
  • Stores job data in a MongoDB collection.
@amcgregor
amcgregor / post.textile
Created July 18, 2012 02:08
On the technology of immortality.

I fully expect to be able to achieve functional immortality within my lifetime. Do not read that as plain immortality—I have little attachment to my own biology. Many argue against this on the basis of biological immortality and philosophical or physical concerns. Over-population, they say, would ruin us; immortality is unnatural the nay-sayers might quip. They might argue that no living creature is meant to live forever, despite several excellent examples of biological creatures that do live forever in a practical sense. Our life span, barring unforeseen events such as cancerous mutations or sudden impacts with a bus, is not fixed at 100 years of age. In 1900 the average life-span was just under a mere 50 years! With technology, we can do better, and have been improving steadily over time.

Let me back up for a moment and claim a specific, and I feel, realistic go

@amcgregor
amcgregor / _overview.textile
Last active October 7, 2015 06:18
A gentle comparison between the coverage reports for identical sample applications across two frameworks, Pyramid and WebCore 2.

The attached CSV files represent the output of the coverage.py running each of the framework’s ‘hello {name}’ examples. Each provide effectively identical example code (one using explicit route/view registration, the other using object dispatch) with absolutely no framework options enabled at all.

The results speak for themselves:

Framework Modules Compiled Executed Skipped Efficiency v. Pyr v. WC RAM
Pyramid 154 21,782 8,055 13,727 36.98% 100% 739% 20.2M
WebCore 2 39 1,938 1,089 849 56.19% 13% 100% 14.4M
@frsyuki
frsyuki / my_thoughts_on_msgpack.md
Created June 11, 2012 02:36
My thoughts on MessagePack

My thoughts on MessagePack

Hi. My name is Sadayuki "Sada" Furuhashi. I am the author of the MessagePack serialization format as well as its implementation in C/C++/Ruby.

Recently, MessagePack made it to the front page of Hacker News with this blog entry by Olaf, the creator of the Facebook game ZeroPilot. In the comment thread, there were several criticisms for the blog post as well as MessagePack itself, and I thought this was a good opportunity for me to address the questions and share my thoughts.

My high-level response to the comments

To the best of my understanding, roughly speaking, the criticisms fell into the following two categories.