As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/bin/bash | |
# Open iPhone Simulator on default location for XCode 4.3 | |
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app | |
# Open mobile safari | |
echo Open mobile safari on emulator and press return | |
read | |
# Plug debug to MobileSafari.app |
As configured in my dotfiles.
start new:
tmux
start new with session name:
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
The spec has moved to a repo: https://github.com/defunctzombie/package-browser-field-spec to facilitate collaboration.
One | Many | |
---|---|---|
Synchronous | T/Try[T] | Iterable[T] |
Asynchronous | Future[T] | Observable[T] |
(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.
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
Is a useful one-liner which will give you the full directory name of the script no matter where it is being called from
These will work as long as the last component of the path used to find the script is not a symlink (directory links are OK). If you want to also resolve any links to the script itself, you need a multi-line solution:
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
/* output: | |
legend: | |
current: Scheduled concurrently by the CurrentThread scheduler. | |
recursive: Scheduled recursively by the Immediate scheduler. | |
setTimeout: Scheduled asynchronously by the Timeout scheduler. | |
blocking-current: Scheduled to block concurrently by the CurrentThread scheduler. | |
blocking-recursive: Scheduled to block recursively by the Immediate scheduler. | |
setTimeout a 0 | |
setTimeout b 0 |
This is a strawman proposal for adding pattern matching to ECMAScript. Pattern matching is useful for matching a value to some structure in a similar way to destructuring. The primary difference between destructuring and pattern matching are the use cases involved - destructuring is useful for binding pieces out of larger structures whereas pattern matching is useful for mapping a value's structure to data or a set of behaviors. In practice this means that destructuring tends to allow many shapes of data and will do its best to bind something out of it, whereas pattern matching will tend to be more conservative.
Additionally, the power of pattern matching is increased substantially when values are allowed to participate in the pattern matching semantics as a matcher as well as a matchee. This proposal includes the notion of a pattern matching protocol - a symbol method that can be implemented by objects that enables developers to use those values in pattern matching. A common scenario w