This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- More Space resoltuion (1440 x 900) | |
-- MacBook Pro 13" Retina, Yosemite version | |
tell application "System Preferences" | |
reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays" | |
end tell | |
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display" | |
click radio button "Display" of tab group 1 | |
click radio button "Scaled" of radio group 1 of tab group 1 | |
click radio button 3 of radio group 1 of group 2 of tab group 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
set frontProcess to first process whose frontmost is true | |
-- When it's down to just Finder and the front process, we have to switch | |
-- to the Finder first to get the front process to hide itself. Furthermore, | |
-- the Finder will not be listed as among the visible processes unless it | |
-- has open windows, so treat a condition of 2 *or fewer* visible apps as | |
-- meaning the Finder should be activated before hiding the front process. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Speed up Mail.app by vacuuming the Envelope Index | |
Code from: http://www.hawkwings.net/2007/03/03/scripts-to-automate-the-mailapp-envelope-speed-trick/ | |
Originally by "pmbuko" with modifications by Romulo | |
Updated by Brett Terpstra 2012 | |
Updated by Mathias Törnblom 2015 to support V3 in El Capitan and still keep backwards compability | |
*) | |
tell application "Mail" to quit | |
set os_version to do shell script "sw_vers -productVersion" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Safari" | |
set vURL to URL of current tab of window 1 | |
end tell | |
tell application "Google Chrome.app" | |
if windows ≠ {} then | |
make new «class CrTb» at the end of window 1 with properties {«class URL »:vURL} | |
else | |
make new window | |
set «class URL » of («class acTa» of window 1) to vURL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Set computer name | |
if [ $# -ne 1 ] && [ "$1" = "" ]; then | |
echo "Missing computer name. Exiting." | |
exit | |
fi | |
COMPUTER_NAME="$1" | |
HOST_NAME=$(echo "$COMPUTER_NAME" | tr '[:upper:]' '[:lower:]') | |
sudo scutil --set ComputerName "$COMPUTER_NAME" | |
sudo scutil --set HostName "$HOST_NAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global] | |
download-cache = /Users/lgw4/.pip/cache | |
respect-virtualenv = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: import sys | |
In [2]: print sys.version | |
2.7.3 (5acfe049a5b0, May 21 2013, 13:47:22) | |
[PyPy 2.0.2 with GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] | |
In [3]: %timeit exes = [x for x in range(1000000)] | |
100 loops, best of 3: 16.3 ms per loop | |
In [4]: %timeit exes = [x for x in xrange(1000000)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: import timeit | |
In [2]: timeit.timeit ('exes = [x for x in range(1000000)]', number=1000) | |
Out[2]: 62.725528955459595 | |
In [3]: timeit.timeit ('exes = [x for x in xrange(1000000)]', number=1000) | |
Out[3]: 48.693825006484985 | |
In [4]: range = getattr(__builtins__, 'xrange', range) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew --config | |
HOMEBREW_VERSION: 0.9.3 | |
HEAD: 4ef158906312451f267821e287a2a38e8ee7343e | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: quad-core 64-bit ivybridge | |
OS X: 10.8.1-x86_64 | |
Xcode: 4.4.1 | |
CLT: 4.4.0.0.1.1249367152 | |
GCC-4.0: N/A |
NewerOlder