Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
# Tested on macOS 13. | |
function manx { | |
if [ "$1" = "" ]; then | |
echo "manx [section] <page>: Creates and opens a PDF for a manpage." | |
else | |
pdfpath="/tmp/$*.man.pdf" | |
man -t $* | pstopdf -o "$pdfpath"; open "$pdfpath" | |
fi | |
} |
This is incomplete. It was inspired by a mutual exchange of eye-opening keyboard shortcuts.
If you want to work creatively, it helps to remove interruptions and wait times. Using a computer is meant to be faster than doing things by hand, and creative work is one reason we use them. We know from experience what it's like to use an app that you have to wait for, versus an app that keeps up with you. The app that keeps up with you lets you do better work because you remain more focused, and it's more fun to use. But you, too, can either be fast or slow as a user. Computers spend most of their time waiting on us. So if you want to do your very best creative work with a computer, it will help if you and the computer get faster together.
private func printData(_ data: Data) { | |
let hexBytes = data.map { byte in | |
String(format: "%02x", byte) | |
} | |
for (offset, hexByte) in hexBytes.enumerated() { | |
let terminator: String | |
switch offset % 8 { | |
case 7: | |
terminator = "\n" |
E017 DO YOU EXPECT ME TO FIGURE THIS OUT? | |
E079 PROGRAMMER IS INSUFFICIENTLY POLITE | |
E099 PROGRAMMER IS OVERLY POLITE | |
E111 COMMUNIST PLOT DETECTED, COMPILER IS SUICIDING | |
E123 PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON | |
E127 SAYING ’ABRACADABRA’ WITHOUT A MAGIC WAND WON’T DO YOU ANY GOOD | |
E129 PROGRAM HAS GOTTEN LOST | |
E139 I WASN’T PLANNING TO GO THERE ANYWAY | |
E182 YOU MUST LIKE THIS LABEL A LOT! | |
E197 SO! 65535 LABELS AREN’T ENOUGH FOR YOU? |
# .khdrc script for https://github.com/koekeishiya/khd | |
# lcmd + .OEU (Dvorak ESDF) = arrows | |
lcmd - o : /usr/local/bin/khd -p "- left" | |
lcmd - e : /usr/local/bin/khd -p "- down" | |
lcmd - 0x0e : /usr/local/bin/khd -p "- up" | |
lcmd - u : /usr/local/bin/khd -p "- right" | |
rcmd + lcmd - o : /usr/local/bin/khd -p "cmd - left" | |
rcmd + lcmd - e : /usr/local/bin/khd -p "cmd - down" |
import GLKit | |
// Uniform index. | |
private enum Uniform { | |
case ModelViewProjectionMatrix, NormalMatrix | |
} | |
private var gUniforms: [Uniform: GLint] = [:] | |
extension GLKMatrix3 { | |
var array: [Float] { |
func curry<T, U, R>(binary: (T, U) -> R) -> T -> U -> R { | |
return { t in | |
return { u in | |
return binary(t, u) | |
} | |
} | |
} | |
func curry<T, U, V, R>(ternary: (T, U, V) -> R) -> T -> U -> V -> R { | |
return { t in |
class Memo<T> { | |
private let closure: () -> T; | |
private var result: T? | |
var value: T { | |
if let value = result { | |
return value | |
} else { | |
let value = closure() | |
println("computed \(value)") |
#!/bin/bash | |
echo "Monitoring." | |
while true; do | |
if curl -s --head $1 | grep "200 OK" > /dev/null; then | |
echo "ok" $1 | |
else | |
echo ":(" $1 | |
fi |