Skip to content

Instantly share code, notes, and snippets.


Nicolas P. Rougier rougier

View GitHub Profile
View Disable Device Enrollment Program (DEP) notification on macOS

Disable Device Enrollment Program (DEP) notification on macOS

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 / bibtex.png
Created Jul 18, 2022 — forked from maxogden/bibtex.png
How to make a scientific looking PDF from markdown (with bibliography)
rougier /
Created May 7, 2022
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 / emacs-dnd-protocol.el
Created Apr 30, 2022
GNU Emacs DND protocol
View emacs-dnd-protocol.el
;; Open scratch buffer, evalute code below and drag and drop some files onto the scratch buffer.
;; Code by Ivan Tadeu Ferreira Antunes Filho
(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
View gist:dacf084aa629a2ecd1b45a1b4fd31eef
# From
# 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 / nano-minibuffer.el
Created Mar 25, 2022
Minibuffer frame for Nano Emacs
View nano-minibuffer.el
;; Nicolas .P Rougier emacs configuration - mini-frame configuration
;; ---------------------------------------------------------------------
(require 'vertico)
(require 'marginalia)
(require 'mini-frame)
(defun minibuffer-setup ()
;; This prevents the header line to spill over second line
(let ((inhibit-message t))
rougier /
Created Feb 1, 2022
NΛNO Emacs font stack

NΛNO Emacs font stack

  • Default font: Roboto Mono , 14pt, Light
  • Italic font: Victor Mono , 14pt, Semilight
  • Bold font: Roboto Mono , 14pt, Regular
  • Unicode font: Inconsolata , 16pt, Light
  • Icon font: Roboto Mono Nerd , 12pt, Light

Text excerpt using a gorgeous and true italic font (Victor Mono), chosen to really stand out from the default font (Roboto Mono).

rougier /
Created Dec 29, 2021
Literate & annotated bibliography using NANO Emacs & orgmode


To Read

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

  title =        {Neuroscience needs evolution},
rougier / drop-shadows.el
Last active Dec 2, 2021
Emacs drop shadows
View drop-shadows.el
(require 'xml)
(require 'svg)
(let* ((text "Hello world!")
(font (query-font (font-at (point-min))))
(font-size (elt font 2))
(family (face-attribute 'default :family))
(descent (elt font 4))
(ascent (elt font 5))
(svg-height (+ ascent descent))
rougier / init-agenda.el
Created Nov 28, 2021
Org agenda with dynamics icons
View init-agenda.el
(require 'svg-lib)
(defun org-agenda-custom-date ()
(let* ((timestamp (org-entry-get nil "TIMESTAMP"))
(timestamp (or timestamp (org-entry-get nil "DEADLINE"))))
(if timestamp
(let* ((timestamp (ts-parse-org timestamp))
(delta (/ (ts-diff timestamp (ts-now)) (* 24 60 60)))
(delta (/ (+ 1 delta) 30))