Skip to content

Instantly share code, notes, and snippets.

View teddyzetterlund's full-sized avatar

Teddy Zetterlund teddyzetterlund

View GitHub Profile

iOS double word VoicerOver fix

  1. Create a temporary folder with a simple index.html file in it
  2. Start a built-in web server with PHP: php -S localhost:8000
  3. Expose your local server to the internet: ssh -R 80:localhost:3000 serveo.net
  4. Go to your generated address (e.g. https://abc.serveo.net) and activate iOS VoiceOver (on your iPhone)

Example index.html file

@teddyzetterlund
teddyzetterlund / flat-formdata.js
Last active October 27, 2021 16:22
Posting FormData to Firebase Realtime Database from React
const PostForm = (props) => {
const handleSubmit = (event) => {
event.preventDefault();
const formData = new FormData(event.target);
let updates = {};
for (const [path, value] of formData.entries()) {
updates[path] = value;
}

What do the words on the right tell our teams?

Some thoughts from [John Cutler's tweet on the importance of words][tweet].

Ship: Value isn't delivered until it's shipped. Everything on the left-hand side is essential to find the right value, but it's no good as long as it's not in front of all your users.

Plan: Take a step back and think ahead. Don't jump straight into the solution. Truly consider the problem, then the solution you want to go with – but even then, think about your approach. If it's related to coding. Will someone have to review it? Can you do it smaller steps, so that review is faster and the change get to production faster?

Commit: Don't give up simply because it's hard. Work together to solve the problem you've all understood and decided is the right thing to spend your time on.

Books I've Read in 2015

Novels

  • Brain on Fire, by Susannah Cahalan
  • The Martian, by Andy Weir

Life

  • Buddhism for Beginners, by Chodron Thubten

Keybase proof

I hereby claim:

  • I am teddyzetterlund on github.
  • I am teddyzetterlund (https://keybase.io/teddyzetterlund) on keybase.
  • I have a public key whose fingerprint is 65EA 6853 C058 5B40 B76F B60C 7437 B583 CD00 C95F

To claim this, I am signing this object:

/**
* base/box-sizing
*
* Apply a natural box layout model to all elements while respecting
* plugins or other components that leverage other behavior.
*
* http://www.paulirish.com/2012/box-sizing-border-box-ftw/
* http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
*/
if (
'querySelector' in document &&
'localStorage' in window &&
'addEventListener' in window
) {
return true;
}
@teddyzetterlund
teddyzetterlund / clipboard-to-omnifocus-inbox.scpt
Last active August 29, 2015 14:00
Adds a task directly to the OmniFocus inbox for each paragraph in the current clipboard.
set _clipboard to get the clipboard
set _tasks to paragraphs of _clipboard
tell application "OmniFocus"
tell default document
repeat with _task in _tasks
make new inbox task with properties {name:_task}
end repeat
end tell
end tell