⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
Custom format for displaying bytes as kb
, mb
, gb
or tb
.
Response to a few places on the internet: https://productforums.google.com/forum/#!topic/docs/x_T_N-yRUYg And here: https://stackoverflow.com/questions/1533811/how-can-i-format-bytes-a-cell-in-excel-as-kb-mb-gb-etc
Here is one that I have been using:
[<1000000]0.00," KB";[<1000000000]0.00,," MB";0.00,,," GB"
addEventListener('fetch', event => { | |
event.respondWith(fetchAndCheckPassword(event.request)) | |
}) | |
async function fetchAndCheckPassword(req) { | |
if (req.method == "POST") { | |
try { | |
const post = await req.formData(); | |
const pwd = post.get('password') | |
const enc = new TextEncoder("utf-8").encode(pwd) |
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
brew unlink postgresql | |
brew install [email protected] | |
brew unlink [email protected] | |
brew link postgresql |
Short link to this page: caseywatts.com/quicktime
Other gists & tricks: http://caseywatts.com/gists-and-tricks
Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book
Scenario: You want to talk with someone over google hangouts (like for a user study), and you want to record BOTH:
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
}; | |
NodeList.prototype.__proto__ = Array.prototype; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
-
Download a Kindle-compatible version of the dictionary here. Unzip the .rar archive.
-
Get the "Send to Kindle" program on your computer. Here's the link for the Mac.
-
Right-click your recently downloaded (unzipped) dictionary file, and click the "Send to Kindle" menu item. It will arrive on your Kindle shortly.
-
Once the dictionary has arrived, go to your settings -- on my newish paperwhite, it's at Home > Settings > Device Options > Language and Dictionaries > Dictionaries > English. Choose the Webster's 1913.
node default { | |
# This is required to apply some manifests since these are not using | |
# appropriate user, group or full path to the command. | |
Exec { | |
group => "staff", | |
user => $boxen_user, | |
path => [ | |
"/usr/local/bin", | |
"/usr/bin", | |
"/bin", |