Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Moved to https://api.fmhy.net
// (Buffer is available in Node.js as a global, but we require it this way for compatibility) | |
// See: https://nodejs.org/api/buffer.html#buffer_buffer | |
const { Buffer } = require('buffer'); | |
const crypto = require('crypto'); | |
const keyPair = crypto.createECDH('secp256k1'); | |
keyPair.generateKeys(); | |
// Print the PEM-encoded private key |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
These use separate document structures instead of HTML, some are more modular libraries than full editors
/* bling.js */ | |
window.$ = document.querySelector.bind(document); | |
window.$$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
NodeList.prototype.__proto__ = Array.prototype; | |
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
#!/bin/bash | |
rm -rf /Volumes/ramdisk | |
if [[ $(mount | awk '$3 == "/Volumes/ramdisk" {print $3}') != "" ]]; then | |
echo /Volumes/ramdisk is mounted | |
else | |
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://8475854` | |
fi |
# coding: utf-8 | |
# based on http://baguzin.ru/wp/?p=7873 | |
import re | |
class AssParser: | |
def __init__(self): | |
self.dialog_re = re.compile(r'Dialogue:(?:[^,]*,){9}(.*)') |
def track_field_changes(only=None, exclude=()): | |
""" | |
Django models decorator for tracking fields changes | |
:only: fields to track for changes (all otherwise) | |
:exclude: fields to exclude from tracking | |
Adds to model instance: | |
get_old_value(field_name) — old value of given field | |
is_changed(field_name=None) — is any field (or given field) is changed |
Update: feeling adventurous? Clone or fork the xkcd clock! If you just want to see it in action or get a glimpse of how it works, keep reading.
The date in [xkcd's comic number 1340][1] [does not change][2].