TypeScript 6.0 is a transition release bridging 5.9 and the forthcoming 7.0 (a native Go port). Most changes are new defaults and deprecations preparing for 7.0. Here is what you need to do:
Most projects need these tsconfig changes:
TypeScript 6.0 is a transition release bridging 5.9 and the forthcoming 7.0 (a native Go port). Most changes are new defaults and deprecations preparing for 7.0. Here is what you need to do:
Most projects need these tsconfig changes:
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 |
{ "compilerOptions": { "types": ["node"], // @types are no longer auto-discovered (see §1.6)