Hacker Newsnew | past | comments | ask | show | jobs | submit | lri's commentslogin

OS X does have sort -u. -u is also in POSIX (http://pubs.opengroup.org/onlinepubs/9699919799/utilities/so...).


All plain text isn't edited or displayed in a fixed-width font. Proportional fonts are used in email, IM, and IRC applications, full screen writing applications, note taking applications, Markdown editors and some LaTeX editors, and text areas on websites. Many email applications display plain text messages in a proportional font and without collapsing spaces.

The two space convention originally became popular to match the practice of inserting wider spaces between sentences in print, but that has more or less fallen out of use.

In many ways, simple typographic conventions are also more esthetical. Does there need to be a distinction between spaces that separate words and spaces that separate sentences? The additional semantic markup isn't worth the extra complexity in many cases. Having two different conventions also adds complexity. Single spaces could eventually become the only format people need to know about, but two spaces couldn't.


It doesn't work with the Colemak input method that comes with OS X though. I don't think there's any way to change caps lock to delete in a keylayout file, but you can always use PCKeyboardHack.


There's at least one shortcut that uses control, option, shift, and command, ⌃⌥⇧⌘., which saves a sysdiagnose report to /var/tmp/.

The reason why key combinations like ⌥← don't work with Unicode Hex Input is probably because they aren't assigned to control characters. I got ⌥← to work after adding this to keymap 3 in the Unicode Hex Input.keylayout that comes with Ukelele:

    <key code="123" output="&#x001c;"/>
You could also use DefaultKeyBinding.dict for inserting Greek characters, but it wouldn't work in Xcode or shell views. (See http://www.hcs.harvard.edu/~jrus/site/KeyBindings/Greek%20Bi...) Another option would be to add keymaps to a keylayout file:

    <keyMapSelect mapIndex="8">
        <modifier keys="caps"/>
    </keyMapSelect>
    <keyMapSelect mapIndex="9">
        <modifier keys="caps anyShift"/>
    </keyMapSelect>
    
    ...
     
    <keyMap index="8">
        <key code="0" output="α"/>
        <key code="1" output="σ"/>
To assign another key to a holdable caps lock, check "Pass-Through CapsLock LED status" and add something like this to private.xml:

    <autogen>
    --KeyToKey--
    KeyCode::N,
    Option::KEYTOKEY_BEFORE_KEYDOWN,
    KeyCode::CAPSLOCK,
    Option::KEYTOKEY_AFTER_KEYUP,
    KeyCode::CAPSLOCK
    </autogen>
I thought something like this might also work:

    <autogen>
    --KeyToKey--
    KeyCode::A,
    ModifierFlag::OPTION_R,
    KeyCode::A,
    Option::KEYTOKEY_BEFORE_KEYDOWN,
    KeyCode::VK_CHANGE_INPUTMODE_RUSSIAN,
    KeyCode::VK_WAIT_10MS,
    Option::KEYTOKEY_AFTER_KEYUP,
    KeyCode::VK_WAIT_10MS,
    KeyCode::VK_CHANGE_INPUTMODE_FINNISH
    </autogen>
Unicode Hex Input or Greek is not included in inputsourcedef.xml though.


If access for assistive devices has been enabled, you can use UI scripting to click the allow buttons:

security find-generic-password -l AppleID -w & sleep 1; osascript -e 'tell app "System Events" to click button 2 of group 1 of window 1 of process "SecurityAgent"'

You could also use something like https://github.com/smerrill/os-x-click even if access for assistive devices wasn't enabled.

    security find-generic-password -l AppleID -w &
    sleep 1
    width=$(osascript -e 'tell app "Finder"
    item 3 of (get bounds of window of desktop)
    end')
    x=$(($width / 2 + 155))
    for y in $(seq 300 20 700); do
        ~/bin/click -x $x -y $y
        sleep 0.2
    done


sudo nvram boot-args="iog=0x0" still works on 10.8.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: