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 / init-tab-line.el
Created February 17, 2024 13:16
Tab line styling for emacs
(require 'tab-line)
(require 'nano-theme)
;; Face for inactive tabs and when window not selected
;; (set-face-attribute 'mode-line nil
;; :foreground (face-foreground 'default)
;; :overline (face-foreground 'default)
;; :height (face-attribute 'default :height)
;; :box nil)
@rougier
rougier / imshow-3d.py
Last active August 27, 2023 08:22
Matplotlib 3D imshow
# Copyright 2023 Nicolas P. Rougier - BSD 2 Clauses licence
# This is an example of 3D projected images with matplotlib using imshow
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
from matplotlib.path import Path
from mpl_toolkits.mplot3d import proj3d
from matplotlib.patches import PathPatch
import matplotlib.transforms as mtransforms
@rougier
rougier / nano-agenda.el
Created July 17, 2023 17:33
NANO Agenda
;;; nano-agenda.el --- N Λ N O agenda -*- lexical-binding: t -*-
;; Copyright (C) 2021-2023 Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
;; Maintainer: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
;; URL: https://github.com/rougier/nano-agenda
;; Version: 0.4.0
;; Package-Requires: ((emacs "27.1"))
;; Keywords: applications, org-mode, org-agenda
@rougier
rougier / org-calendar.el
Created January 6, 2023 18:11
Emacs / Generate a month view
(defun org-calendar-face (date)
'default)
(defun org-calendar-generate-month (year month)
(let* ((first (calendar-day-of-week (list month 1 year)))
(first (+ (mod (+ (- first 1) 7) 7) 1)) ;; Week starts on Monday
(last (+ first (calendar-last-day-of-month month year)))
(days ""))
(dotimes (row 6)
(dotimes (col 7)
@rougier
rougier / folding-box.el
Created November 21, 2022 19:01
An emacs folding box function
(defun folding-box (content &optional size title prefix type folded)
"Enclose TEXT with a box of given SIZE with an optional TITLE at
the top.
If a PREFIX is given, it is prepended to the box such that total
size is enforced, including prefix. If a title is given, the
content of the box can be shown/hidden by clicking on the title
and initial state is specified with FOLDED. The type of the box
can be either 'unicode or 'ascii."
@rougier
rougier / mastodon-tl-alternative.el
Last active July 24, 2023 16:13
A different timeline layout for the Emacs mastond client
;;; init-mastodon.el --- Mastodon layout mockup -*- lexical-binding: t -*-
;; Copyright (C) 2022 Nicolas P. Rougier
;; This file is not part of GNU Emacs.
;; This file 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, or (at your option)
;; any later version.
@rougier
rougier / gist:de8643f43d05fd8514912198d21a212e
Created November 18, 2022 12:03
Emacs Mastodon client mockup
;;; init-mastodon.el --- Mastodon layout mockup -*- lexical-binding: t -*-
;; Copyright (C) 2022 Nicolas P. Rougier
;; This file is not part of GNU Emacs.
;; This file 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, or (at your option)
;; any later version.
@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")

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 / 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