Skip to content

Instantly share code, notes, and snippets.

View danlamanna's full-sized avatar
🏠

Dan LaManna danlamanna

🏠
View GitHub Profile
with settings(host_string="[email protected]:7491"):
run("ls")
#+NAME: test
#+BEGIN_SRC C
int main(int argc, char *argv[]) {
printf("test\n");
return 0;
}
@danlamanna
danlamanna / gist:369f42089655af4b6bad
Created September 29, 2014 01:59
List the number of files in your dired buffer
(if (equal major-mode 'dired-mode)
(save-excursion
(goto-char (point-max))
(format "(%d files)" (- (line-number-at-pos) 5))))
;; -5 is a hack, but I think it will actually always work since dired requires -al at a minimum.

To Watch

Utopia? Series?

24

Agents of Shield

American Horror Story

Seen season 1

Archer

Awake

Band of Brothers

Battlestar Galactica

fun mytake n ls = if n = 0 orelse ls = nil then nil
else hd(ls)::mytake (n-1) tl(ls);
(bind-key "C-n" (lambda()
(interactive)
(if (boundp 'foo)
(message "yay foo")
(next-line))) dired-mode-map)
class Foo:
count = 0
def __init__(self, count):
self.count = count
elements = [Foo(5), Foo(2), Foo(4), Foo(1)]
elements.sort(key=lambda x: x.count)
(use-package python
:commands python-mode
:config (progn
(setq pylint:epylint-executable "epylint"
python-shell-interpreter "ipython"
python-shell-interpreter-args "-i"
python-shell-buffer-name "Python"
python-shell-prompt-regexp "In \\[[0-9]+\\]: "
python-shell-prompt-block-regexp ":"
python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: ")
def sort(l):
for i in xrange(1, len(l)):
val = l[i]
j = i - 1
while j >= 0 and l[j] > val:
l[j+1] = l[j]
j -= 1
970 2012-12-14 12:42:25
971 2012-12-14 13:17:15
972 2012-12-14 13:37:52
976 2012-12-14 13:54:27
978 2012-12-14 14:39:01