Skip to content

Instantly share code, notes, and snippets.

View rougier's full-sized avatar
:octocat:

Nicolas P. Rougier rougier

:octocat:
View GitHub Profile
@rougier
rougier / mu4e-fast-folding.el
Last active October 10, 2022 18:23
Blazing fast mu4e thread folding
;; mu4e thread fast folding -*- lexical-binding: t; -*-
;; This file is not part of GNU Emacs.
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation, either version 3 of the
;; License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
@rougier
rougier / quick-command.el
Last active September 19, 2022 11:26
Emacs proof of concept: emulating minibuffer in the mode line
(defface quick-command-face
`((t :foreground ,(face-foreground 'default)
:background ,(face-background 'highlight nil t)
:height ,(face-attribute 'default :height)
:box '(:line-width (1 . 1)
:color ,(face-foreground 'default)
:style none)))
"Face for quick command")
@rougier
rougier / marker-rotation.py
Created November 27, 2016 07:32
Matplotlib / individual rotation markers using a single path
# Matplotlib / individual rotation markers using a single path
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.path import Path
from matplotlib.animation import FuncAnimation
from matplotlib.collections import PathCollection
triangle = [[(-0.25, -0.5), (+0.0, +0.5), (+0.25, -0.5), (+0.0, +0.0)],

Disable Device Enrollment Program (DEP) notification on macOS Monterey.md

NB! command-R is replaced with holding the power button on M1 macs.

With full reinstall (recommended)

   a. Boot into recovery using command-R during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS

   b. Initial installation will run for approximately 1 hour, and reboot once

@rougier
rougier / Toolbar.el
Created November 30, 2020 12:05
Emacs SVG Toolbar
;; An experiment for an SVG toolbar using icons from material.io
;;
;; Example usage: (toolbar 48 "black" "white" t t)
;; Material icons freely available (Apache 2 license) from
;; - https://material.io/resources/icons/?style=outline
;; - https://github.com/google/material-design-icons
(require 'xml) (require 'svg)
(defun toobar-item (label icon fg-color bg-color size with-icon with-label)
@rougier
rougier / bibtex.png
Created July 18, 2022 04:22 — forked from max-mapper/bibtex.png
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@rougier
rougier / imenu-filter.org
Created May 7, 2022 18:06
Filter for imenu-list

Section 1

Section 1.1

Section 1.1.1

Section 1.1.2

Section 1.2

Section 1.2.1

Section 1.2.2

@rougier
rougier / emacs-dnd-protocol.el
Created April 30, 2022 12:57
GNU Emacs DND protocol
;; Open scratch buffer, evalute code below and drag and drop some files onto the scratch buffer.
;; Code by Ivan Tadeu Ferreira Antunes Filho
;; https://ivanaf.com/emacs_drag-drop_pdfs_paste_html_custom_templates.html
(defun scratch--file-insert (uri)
(message "%s" uri))
(defun scratch--file-dnd-fallback (uri action)
(let ((dnd-protocol-alist
(rassq-delete-all 'scratch--file-dnd-protocol
# From https://stackoverflow.com/questions/9755538/how-do-i-create-a-list-of-random-numbers-without-duplicates
# Code by Thomas Lux
#
# Return a randomized "range" using a Linear Congruential Generator
# to produce the number sequence. Parameters are the same as for
# python builtin "range".
# Memory -- storage for 8 integers, regardless of parameters.
# Compute -- at most 2*"maximum" steps required to generate sequence.
#
def random_range(start, stop=None, step=None):
@rougier
rougier / bibliography.org
Created December 29, 2021 14:29
Literate & annotated bibliography using NANO Emacs & orgmode

Unsorted

To Read

Neuroscience needs evolution [cite:@Cisek:2021] |PDF|

@article{Cisek:2021,
  title =        {Neuroscience needs evolution},