Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Nicolas P. Rougier rougier

:octocat:
View GitHub Profile
@rougier
rougier / style.css
Created Jun 23, 2021
Jupyter stylesheet
View style.css
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400&family=Source+Code+Pro:wght@300;400&display=swap');
.rendered_html h1,
.rendered_html h2,
.rendered_html h3,
.rendered_html h4 {
color: #000099;
font-weight: 400;
}
View mu4e-side-dashboard.el
(require 'mu4e)
(require 'mu4e-dashboard)
(setq mu4e-sidebar-frame nil)
(setq mu4e-sidebar-dashboard-file "~/.emacs.d/lisp/dashboard.org")
(defun mu4e-sidebar-create (dashboard-file)
(let ((width (frame-pixel-width))
(height (frame-pixel-height))
(frame (make-frame `((parent-frame . ,(window-frame))
@rougier
rougier / Toolbar.el
Created Nov 30, 2020
Emacs SVG Toolbar
View Toolbar.el
;; 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 / tag.el
Last active Jan 16, 2021
Rounded boxed tags for Emacs
View tag.el
;; ---------------------------------------------------------------------
;; Tag minor mode
;; Copyright (C) 2020 Nicolas .P Rougier
;;
;; 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,
@rougier
rougier / nano.el
Created Oct 2, 2020
A very minimal emacs configuration
View nano.el
;; nano.el -- A very minimal emacs
;; Usage: emacs -q -l nano.el
;;
;; Copyright (C) 2020 Nicolas .P Rougier
;;
;; Author: Nicolas P. Rougier <nicolas.rougier@inria.fr>
;;
;; 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
View emacs-animations.el
;; animations
;; Requires =emacs-mac= fork
;; repo: https://bitbucket.org/mituharu/emacs-mac
;; homebrew tap: https://github.com/railwaycat/homebrew-emacsmacport
;; Crazy example
(mac-start-animation nil :type 'page-curl-with-shadow
:duration 1.0 :direction 'right :angle 45)
;; Less crazy
(mac-start-animation (selected-window) :type 'move-out
@rougier
rougier / echo-line.el
Created Aug 11, 2020
An extension of the echo area to display static messages (emacs)
View echo-line.el
;; -------------------------------------------------------------------
;; An extension of the echo area to display static messages
;; Copyright 2020 Nicolas P. Rougier
;; -------------------------------------------------------------------
;; 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.
@rougier
rougier / enhanced-message.el
Last active Oct 21, 2020
Emacs: persistent message in the echo area
View enhanced-message.el
(require 'subr-x)
(defun enhanced-message (orig-fun &rest args)
"This enhanced message displays a regular message in the echo area
and adds a specific text on the right part of the echo area. This
is to be used as an advice."
(let* ((right (propertize
;; Hack: The first space is a thin space, not a regular space
(format-time-string "  %A %d %B %Y, %H:%M ")
'face '(:height 0.85
View gist:ddb84c16c28f7cd75e27e50d4c3c43da
(defun elegant-agenda (char-width char-height)
""
(interactive)
(select-frame (make-frame))
(set-frame-width (selected-frame) char-width)
(set-frame-height (selected-frame) char-height)
(set-frame-position (selected-frame)
(/ (- (display-pixel-width) (frame-outer-width)) 2)
(/ (- (display-pixel-height) (frame-outer-height)) 2))
(x-focus-frame nil)
@rougier
rougier / material-colors.el
Created Jul 31, 2020
Emacs year calendar in a dedicated frame
View material-colors.el
;; Material colors from https://material.io/design/color/
(defconst levels
(list "L50" "L100" "L200" "L300" "L400"
"L500" "L600" "L700" "L800" "L900"
"A100" "A200" "A400" "A700"))
(defconst red
(list "#FFEBEE" "#FFCDD2" "#EF9A9A" "#E57373" "#EF5350"
"#F44336" "#E53935" "#D32F2F" "#C62828" "#B71C1C"
"#FF8A80" "#FF5252" "#FF1744" "#D50000"))