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
(require 'server) | |
(server-start) | |
(defun nkv-find-file-and-jump (spec) | |
(interactive "s") | |
(let ((f (car (split-string spec ":"))) | |
(l (cadr (split-string spec ":")))) | |
(find-file f) | |
(if l (goto-line (string-to-int l))))) |
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
function alarm() { | |
# First argument is the number of minutes spent on work (one pomodoro) | |
# Second argument is the rest time. | |
# I usually invoke this as alarm 30 5 (work for 30 minutes, rest for 5) | |
work_time=$(echo "$1*60" | bc) | |
rest_time=$(echo "$2*60" | bc) | |
( mpg123 --loop -1 ~/scratch/clock-ticking-4.mp3 > /dev/null 2>&1 & | |
mpg123pid=$! | |
(sleep ${work_time} && | |
kill $mpg123pid && |
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
; Cheap and dirty session management for Emacs. | |
; Add the location of this file to your load-path, | |
; Do a (require 'nkv-session) in your .emacs | |
; Then hit f9 to load up your session files. | |
; While you work, if you want to remember a file, hit f9 in the buffer. | |
; If you want to remember all the current open buffers, you can simply call nkv/session-save-current-buffers | |
; Whenever you want to save, call nkv/save-session. | |
; Or you can add nkv/save-session to kill-emacs-hook to save the session upon quit automatically. | |
; Next time, hit f9 to reload your files. | |
; |
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
\documentclass {beamer} | |
\usepackage{graphics} | |
\usepackage{listings} | |
\usetheme{Berkeley} | |
\title {Plugin frameworks} | |
\subtitle {3 approaches to designing plugin APIs} |
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 sort-lines-by-length (b e) | |
(interactive "r") | |
(save-excursion | |
(save-restriction | |
(narrow-to-region b e) | |
(let ((items (sort | |
(split-string | |
(buffer-substring (point-min) (point-max)) "[\n]") | |
(lambda(x y) (< (length x) (length y))))) | |
) |
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 python | |
import pygame | |
from pygame.locals import * | |
from pygame.color import Color | |
from pygments.lexers import PythonLexer | |
from pygments.styles.emacs import EmacsStyle | |
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 python | |
import pygame | |
from pygame.locals import * | |
from pygame.color import Color | |
from pygments.lexers import PythonLexer | |
from pygments.styles.emacs import EmacsStyle | |
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 nkv/stop-here (pos) | |
(interactive "d") | |
(let ( | |
(trace-command "import pdb; pdb.set_trace()") | |
) | |
(save-excursion | |
(save-restriction | |
(widen) | |
(goto-char (point-min)) | |
(search-forward trace-command nil t) |
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
ARCHIVE_DIR=/home/noufal/projects/emacsmovies.org/videos | |
all: generate archive | |
upload: generate | |
curl --location --header "authorization: LOW xxxx:yyyy" --upload-file ./${number}-episode-${name}.webm http://s3.us.archive.org/EmacsMovies/${number}-episode-${name}.webm | |
curl --location --header "authorization: LOW xxxx:yyyy" --upload-file ./${number}-episode-${name}.mkv http://s3.us.archive.org/EmacsMovies/${number}-episode-${name}.mkv | |
archive: ${number}-episode-${name}.webm |
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
showrepo () { | |
img=$(tempfile -s.png) | |
~/bin/showrepo.rb $1 | dot -Tpng > $img | |
echo $img | |
qiv $img | |
} | |
showdag () { | |
img=$(tempfile -s.png) |
OlderNewer