Skip to content

Instantly share code, notes, and snippets.

#include <flusspferd.hpp>
class class_info : public flusspferd::class_info {
char const *full_name_;
flusspferd::object proto;
char const *constructor_name_;
template<typename T>
friend class class_builder;
public:
@ruediger
ruediger / gist:105308
Created May 1, 2009 22:57
flusspferd.gmp example
gmp = require('gmp')
var f = gmp.Float(2);
f.get_int();
f.sqrt().get_double();
@ruediger
ruediger / bar.vhdl
Created May 23, 2012 19:52
simple vhdl example
library ieee;
use ieee.std_logic_1164.all;
entity counter is
port (
clk : in std_logic;
o : out std_logic);
end entity counter;
@ruediger
ruediger / rct.bash
Created November 6, 2012 22:59
rct wrapper
${CXX:-g++} -fplugin=$(pwd)/python.so -fplugin-arg-python-script=$(pwd)/src/rct.py "${@/--rct-/--fplugin-arg-python-rct-}"
@ruediger
ruediger / gist:5338669
Created April 8, 2013 17:30
compile buffer stuff
;; 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))
@ruediger
ruediger / gist:5345354
Last active December 16, 2015 00:09
renumber-offset
(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))
@ruediger
ruediger / holidays.el
Last active January 16, 2024 13:02
Austrian Holidays for Emacs (Diary)
;; 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")
(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)
@ruediger
ruediger / attributes
Last active April 14, 2025 13:54
A collection of additional "custom hunk header" patterns for .gitattributes. This provides better context in the diff hunk header.
*.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
@ruediger
ruediger / init-bibtex-mode.el
Last active December 17, 2015 17:58
urlify doi entries in bibtex
;; 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)