View gist:23c3e88c7685d77b95a8c380d08cbd45
NSVisualEffectMaterial constants, and the undocumented materials they coorespond to in various modes:
+----------------------+-------+----------+------+---------+
| MATERIAL # | LIGHT | LIGHT EM | DARK | DARK EM |
+----------------------+-------+----------+------+---------+
| | | | | |
| 0 - Appearance Based | 3 | 3 | 5 | 5 |
| | | | | |
| 1 - Light | 3 | 3 | 3 | 3 |
| | | | | |
| 2 - Dark | 4 | 4 | 4 | 4 |
View node-child-process-perf-sync-vs-async.md

Measuring sync vs async child processes in Node.js

  • macOS 10.12.3
  • Node.js 7.4.0

childProcess

const childProcess = require('child_process');
View TrueColour.md

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
View writing-eslint-rule.md

Gettings started writing a ESLint rule

First, take a look at the ESLint rule documentation. Just skim it for now. It's very long and boring. You can come back to it later.

ESLint rules works on the AST (Abstract Syntax Tree) representation of the code. In short, this is a tree structure that describes the code in a very verbose form. ESLint walks this tree and rules can subscribe to be notified when it hits a specific node type, like a Literal type, which could be the "hello" part of const welcome = "hello";.

Go ahead and play around with some code in AST Explorer (Make sure the parser is espree). It's a great tool!

Here are some good articles on the subject (ignore the scaffolding parts):

View .profile
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
View index.js
var minimist = require('minimist');
console.log(minimist(['ava', '--watch', 'src/*.js', 'test/*.js'], {
string: ['watch']
}));
View compile-objc.sh
# -fobjc-arc: enables ARC
# -fmodules: enables modules so you can import with `@import AppKit;`
# -mmacosx-version-min=10.6: support older OS X versions, this might increase the binary size
clang main.m -fobjc-arc -fmodules -mmacosx-version-min=10.6 -o main
View app-path.swift
import AppKit
func getPath(app: String) -> String? {
let workspace = NSWorkspace.sharedWorkspace()
if app.rangeOfString(".") != nil {
return workspace.absolutePathForAppBundleWithIdentifier(app)
} else {
return workspace.fullPathForApplication(app)
}
View bali-top-things-to-see-do.md

Bali top things to see/do

  1. Uluwatu
  2. Blue Point beach
  3. Kuta Beach
  4. Balangan Beach
  5. Padang-Padang Beach
  6. Tanah Lot
  7. Pasar Sukawati
  8. Nusa Ceningan
View keybase.md

Keybase proof

I hereby claim:

  • I am sindresorhus on github.
  • I am sindresorhus (https://keybase.io/sindresorhus) on keybase.
  • I have a public key whose fingerprint is DC35 049E A1F5 A23A 232C C7A9 A1D5 B51E 19F6 8B56

To claim this, I am signing this object: