This file contains hidden or 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
# show git branch in prompt | |
# got it from https://gist.github.com/790086 | |
parse_git_branch() { | |
ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return | |
printf "${1:-(%s)}" "${ref#refs/heads/}" | |
} | |
parse_svn_revision() { | |
local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //') |
This file contains hidden or 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
;; defadvice sample for dropdive | |
(defadvice ask-user-about-supersession-threat (around ask-user-supersession-with-diff activate) | |
"Diff the buffer with the backing (modified) file" | |
(diff-buffer-with-file) | |
ad-do-it) |
This file contains hidden or 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
(query-replace-regexp "\"description\": \\[ | |
.* | |
.* | |
.* | |
.*\\]" "REPLACED!" nil (if (and transient-mark-mode mark-active) (region-beginning)) (if (and transient-mark-mode mark-active) (region-end))) ;; C-x C-e here | |
"description": [ | |
foo, | |
bar, | |
baz, |
This file contains hidden or 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
"description": [ | |
foo, | |
bar, | |
baz, | |
ban ] | |
"description": [ | |
foo2, | |
bar2, | |
baz2, |
This file contains hidden or 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
gist.el test test test |
This file contains hidden or 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
# verifying firefox signature on live distro | |
user@debian:~/Downloads$ gpg --verify firefox-7.0.1.tar.bz2.asc firefox-7.0.1.tar.bz2 | |
gpg: Signature made Fri 30 Sep 2011 06:39:02 PM UTC using DSA key ID C52175E2 | |
gpg: Can't check signature: public key not found | |
user@debian:~/Downloads$ gpg --search-keys C52175E2 | |
gpg: searching for "C52175E2" from hkp server keys.gnupg.net | |
(1) Mozilla Software Releases <[email protected]> | |
1024 bit DSA key 1EBCAB3A, created: 2011-07-22 |
This file contains hidden or 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
2: [ [ 3, 3, 3 ] | |
[ 1, 2, 3 ] | |
[ 4, a, c ] ] | |
;; V D | |
1: 6 c + 36 + 3 a - 24 - 9 a - 3 c |
This file contains hidden or 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
;; X looks | |
(setq initial-frame-alist | |
'((menu-bar-lines . 0) | |
(tool-bar-lines . 0) | |
(horizontal-scroll-bars . nil) | |
(vertical-scroll-bars . nil) | |
(foreground-color . "bisque2") | |
(background-color . "dark slate gray") | |
(cursor-color . "orange") | |
(mouse-color . "dark slate gray") |
This file contains hidden or 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
(require 'url) | |
(let ((url-request-method "POST") | |
(url-request-extra-headers '(("Content-Type" . "application/x-www-form-urlencoded"))) | |
(url-request-data "field1=Hello&field2=from&field3=Emacs")) | |
(with-current-buffer (url-retrieve-synchronously "http://example.net/foo/bar") (buffer-string))) ;; C-x C-e here to POST |
This file contains hidden or 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
function Ring:disconnect_ring(other_ring) | |
local mapEntry= self.other_rings[other_ring] | |
local tangent= mapEntry.tangent | |
klog.debug("DISCONNECTING %s(%s) -> %s(%s) ", self.id, tostring(self), other_ring.id, tostring(other_ring), tostring(mapEntry.tangent)) | |
if not mapEntry then | |
log.warning("Trying to disconnect %d from %d but no previous connection existed", self.id, other_ring.id) | |
end | |
self.other_rings[other_ring]= nil -- other_ring is not mapped anymore |