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
// Quick C++11 Quiz | |
typedef istreambuf_iterator<char> iter; | |
stringstream ss("a"); | |
iter const i(ss); | |
iter j(i); | |
iter const end; | |
++j; | |
cout << boolalpha << (j == end) << " " << (i == end) << endl; |
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/bash | |
function die() { | |
echo "Error: ${@}!" >&2 | |
exit 1 | |
} | |
: "${INPUT_DATA_PATH:=~/develop/hermsk/mpauli/}" | |
input= |
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
$ git pull | |
fatal: mark :399671 not declared | |
fast-import: dumping crash report to .git/fast_import_crash_4248 | |
fatal: Error while running fast-import | |
Traceback (most recent call last): | |
File "/usr/bin/git-remote-bzr", line 952, in <module> | |
sys.exit(main(sys.argv)) | |
File "/usr/bin/git-remote-bzr", line 936, in main | |
do_import(parser) | |
File "/usr/bin/git-remote-bzr", line 398, in do_import |
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
;; A better version of this is now upstream! See comments. | |
;; bibtex-mode | |
(add-hook 'bibtex-mode-hook | |
(lambda () | |
(setq bibtex-generate-url-list | |
(cons (list '("doi" . "10\\.[0-9]+/.+") | |
(concat (or org-doi-server-url "http://dx.doi.org/") "%s") | |
'("doi" "10\\.[0-9]+/.+" 0)) | |
bibtex-generate-url-list) |
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
*.tex diff=tex | |
*.bib diff=bibtex | |
*.c diff=cpp | |
*.h diff=cpp | |
*.c++ diff=cpp | |
*.h++ diff=cpp | |
*.cpp diff=cpp | |
*.hpp diff=cpp | |
*.cc diff=cpp | |
*.hh diff=cpp |
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 browse-in-open-browser (&rest args) | |
(apply | |
(or (cl-dolist (process (proced-process-attributes)) | |
(let* ((process-data (cdr process)) | |
(comm (cdr (assq 'comm process-data)))) | |
(when (string= (cdr (assq 'user process-data)) user-login-name) | |
(cond | |
((string= comm "firefox") | |
(cl-return #'browse-url-firefox)))))) | |
#'browse-url-default-browser) |
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
;; Diary | |
(require 'holidays) | |
(setq holiday-austria-holidays '((holiday-fixed 1 1 "Neujahr") | |
(holiday-fixed 1 6 "Heilige Drei Könige") | |
(holiday-easter-etc 1 "Ostermontag") | |
(holiday-fixed 5 1 "Staatsfeiertage") | |
(holiday-easter-etc 39 "Christi Himmelfahrt") | |
(holiday-easter-etc 50 "Pfingstmontag") | |
(holiday-easter-etc 60 "Fronleichnam") | |
(holiday-fixed 8 15 "Mariä Himmelfahrt") |
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 renumber-offset (&optional offset regex subexp) | |
"Add OFFSET to any number matching REGEXP. | |
If OFFSET is nil then 1 is chosen. | |
If REGEXP is nil then only numbers at the beginning of line are replaced. | |
SUBEXP can be used to give the number of the subexp of REGEX." | |
(interactive "p") | |
(setq offset (or offset 1)) | |
(setq regex (or regex "^[[:digit:]]+")) | |
(save-excursion | |
(goto-char (point-min)) |
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
;; Compile-Buffer | |
(setq compilation-scroll-output 'first-error) | |
(defmacro my-compile-command (compiler flags) | |
"Create mode hook to generate `compile-command'." | |
`(lambda () | |
(flyspell-prog-mode) | |
(unless (or (file-exists-p "Makefile") | |
(local-variable-p 'compile-command) | |
(not buffer-file-name)) |
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
${CXX:-g++} -fplugin=$(pwd)/python.so -fplugin-arg-python-script=$(pwd)/src/rct.py "${@/--rct-/--fplugin-arg-python-rct-}" |
NewerOlder