Skip to content

Instantly share code, notes, and snippets.

Heikki Lehvaslaiho heikkil

Block or report user

Report or block heikkil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@heikkil
heikkil / raw_copy
Created Feb 4, 2016
copy raw images corresponding to jpgs in a subdir into an other subdir
View raw_copy
#!/usr/bin/env perl
use Modern::Perl;
use File::Find;
use Getopt::Long;
use constant PROGRAMME_NAME => 'raw_copy';
use constant VERSION => '0.2';
GetOptions(
'v|version' => sub{ print PROGRAMME_NAME, ", version ", VERSION, "\n";
@heikkil
heikkil / fill-or-unfill.el
Created Aug 28, 2018
Version of #'endless/fill-or-unfill and key bindings that work in org-mode
View fill-or-unfill.el
(defun endless/fill-or-unfill ()
"Like `fill-paragraph', but unfill if used twice."
(interactive)
(let ((fill-column
(if (eq last-command #'endless/fill-or-unfill)
(progn (setq this-command nil)
(point-max))
fill-column)))
(if (eq major-mode 'org-mode)
(call-interactively #' org-fill-paragraph)
@heikkil
heikkil / org-clock-merge.el
Last active Mar 4, 2019
Merge the org CLOCK line with the next CLOCK line
View org-clock-merge.el
(defun org-clock-merge (arg)
"Merge the org CLOCK line with the next CLOCK line.
Requires that the time ranges in two lines overlap, i.e. the
start time of the first line and the second time of the second
line are identical.
If the testing fails, move the cursor one line down.
Universal argument ARG overrides the test and merges
@heikkil
heikkil / org-duplicate-heading.el
Last active Mar 17, 2019
Report org headings with duplicate names in the *Messages* buffer. Reveal them and move to the last duplicate. Run after saving the buffer.
View org-duplicate-heading.el
(require 'dash)
(defun org-duplicate-heading ()
"Move to duplicate heading in the current org buffer."
(interactive)
(let ((header-list '()))
(org-element-map (org-element-parse-buffer) 'headline
(lambda (x)
(let ((header (org-element-property :raw-value x))
(begin (org-element-property :begin x)))
(when (-contains? header-list header)
You can’t perform that action at this time.