I hereby claim:
- I am jonEbird on github.
- I am jonebird (https://keybase.io/jonebird) on keybase.
- I have a public key whose fingerprint is 7643 3897 1509 964E 1C00 A027 ACD1 AB35 6CA2 12CF
To claim this, I am signing this object:
#!/bin/env python | |
# Taken from http://www.dzone.com/snippets/remote-debugging-python-using | |
# Only added the SO_REUSEADDR socket option since I hit the breakpoint often | |
import pdb, socket, sys | |
class Rdb(pdb.Pdb): | |
def __init__(self, port=4444): | |
self.old_stdout = sys.stdout |
#!/bin/bash | |
# -*- python -*- | |
"true" '''\' | |
# | |
# Shell Code that helps you setup useful variables. Source this script. | |
# | |
BN=$(basename -- $0) | |
if [ "$BN" == "bash" -o "$BN" == "zsh" -o "$BN" == "sh" ]; then | |
if [ -z "${SPACEWALK_USER}" ]; then |
I hereby claim:
To claim this, I am signing this object:
;; Help for attaching buffers and files | |
; I find it annoying that I have to move to the end of the email to attach | |
; or suffer the recepients getting the 2nd part of my email in a | |
; mime-attached generic part | |
(defun attach-buffer () | |
"Call mml-attach-buffer but only after moving to the end of the message" | |
(interactive) | |
(save-excursion | |
(goto-char (point-max)) | |
(call-interactively 'mml-attach-buffer))) |
; Launch a unique shell for the particular session or project | |
(defun jsm/unique-shell (&optional directory) | |
"Start or return to a shell session named and started from a particular directory" | |
(interactive) | |
(let* ((basedir (or directory (read-directory-name "Base Directory: "))) | |
(default-directory basedir)) | |
(shell (concat "*ProjSH* " | |
(file-name-base (replace-regexp-in-string "/*$" "" basedir)))))) | |
(defun jsm/projectile-shell-other-window () |
;; Markdown preview helper | |
;; ------------------------------ | |
(defun jsm/markdown-preview () | |
"Preview the markdown file in a new browser tab" | |
(interactive) | |
(let ((my-filename (buffer-file-name)) | |
(html-filename (format "%s.html" (file-name-base (buffer-file-name))))) | |
(shell-command (format "pandoc -f markdown_github -t html -o %s %s" html-filename my-filename) nil nil) | |
(browse-url (concat "file://" (file-name-directory (buffer-file-name)) html-filename)))) | |
(define-key markdown-mode-map (kbd "<f12>") 'jsm/markdown-preview) |
(defvar screenkey-timeout 4 | |
"Number of seconds to allow screenkey to run normally") | |
(defun screenkey-timed (&optional timeout) | |
"Run an external command and then asynchronously kill it after timeout" | |
(interactive) | |
(start-process "screenkey" "*screenkey*" "screenkey" "--no-detach") | |
(run-at-time (format "%d sec" (or timeout screenkey-timeout)) nil | |
'(lambda () (delete-process "*screenkey*")))) | |
;; Simulate GNU Screen within Emacs using ansi-term | |
;; ------------------------------ | |
(defun term-next () | |
"Go to the next terminal based on the buffer name. Will extract the | |
number from the buffer-name, add 1 and go to a buffer of that name if it | |
exists." | |
(interactive) | |
(let ((cur-buffer (buffer-name))) | |
(if (string-match "\\([0-9]+\\)" cur-buffer) | |
(let* ((n (match-string-no-properties 0 cur-buffer)) |
;; Allow isearch functionality with multiple-cursors | |
(require 'phi-search) | |
(setq phi-search-limit 10000) | |
(add-hook 'multiple-cursors-mode-enabled-hook | |
(lambda () | |
(interactive) | |
(global-set-key (kbd "C-s") 'phi-search) | |
(global-set-key (kbd "C-r") 'phi-search-backward))) | |
(add-hook 'multiple-cursors-mode-disabled-hook | |
(lambda () |
import os | |
import sys | |
import stat | |
import shutil | |
import tempfile | |
import logging as log | |
class UpdateFile(object): | |
"""Update a file atomically |