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
on replace_chars(this_text, search_string, replacement_string) | |
set AppleScript's text item delimiters to the search_string | |
set the item_list to every text item of this_text | |
set AppleScript's text item delimiters to the replacement_string | |
set this_text to the item_list as string | |
set AppleScript's text item delimiters to "" | |
return this_text | |
end replace_chars | |
on dlog(foo) |
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
>>> class Old: pass | |
... | |
>>> type(Old) | |
<type 'classobj'> | |
>>> class New(object): pass | |
... | |
>>> type(New) | |
<type 'type'> | |
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
class Foo(object): | |
def is_it_a_foo(self, other): | |
print issubclass(Foo, other) | |
Foo().is_it_a_foo(Foo) |
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
Program received signal: “SIGABRT”. | |
(gdb) thread apply all bt | |
Thread 2 (process 829): | |
#0 0x0000000100032ca2 in kevent () | |
#1 0x00000001000350b6 in _dispatch_mgr_invoke () | |
#2 0x000000010003485f in _dispatch_queue_invoke () | |
#3 0x00000001001b7adc in _dispatch_continuation_pop () | |
#4 0x0000000100034433 in _dispatch_worker_thread2 () | |
#5 0x0000000100033d6b in _pthread_wqthread () |
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
#!/bin/zsh -ef | |
# Stop Time Machine & AppleFileServer | |
export PATH=/bin:/usr/bin:/usr/sbin:/usr/libexec | |
setopt extendedglob | |
diskutil mount $(diskutil list | awk '/MaryBackup\+ A/ { print $NF }') | |
[[ $(id -u) == 0 ]] || { print "$0: must be running as root" >&2 ; exit 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
#!/bin/zsh -ef | |
export PATH=/bin:/usr/bin:/usr/sbin:/usr/libexec | |
setopt extendedglob | |
diskutil unmount $(diskutil list | awk '/MaryBackup\+ A/ { print $NF }') | |
[[ $(id -u) == 0 ]] || { print "$0: must be running as root" >&2 ; exit 1 } | |
# enable AppleFileServer |
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
import re, htmlentitydefs | |
# from http://effbot.org/zone/re-sub.htm#unescape-html | |
def unescape(text): | |
def fixup(m): | |
text = m.group(0) | |
if text[:2] == "&#": | |
# character reference | |
try: | |
if text[:3] == "&#x": |
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
[uwsgi] | |
socket = 127.0.0.1:46918 | |
chdir = /home/hg/reviews/conf | |
env = DJANGO_SETTINGS_MODULE=reviewboard.settings | |
env = HOME=/home/hg/reviews/data | |
module = django.core.handlers.wsgi:WSGIHandler() | |
enable-threads = true | |
master = true | |
threads = 5 | |
processes = 2 |
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
(defun toggle-frame-fullscreen (&optional frame) | |
(interactive) | |
(set-frame-parameter frame 'fullscreen | |
(if (null (frame-parameter frame 'fullscreen)) | |
'fullboth nil))) | |
(global-set-key "\C-x59" 'toggle-frame-fullscreen) | |
; ediff-toggle-wide-display tries to use the entire display width, | |
; which breaks with multiple monitors |
OlderNewer