This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'org) | |
(setq-default indent-tabs-mode nil) | |
(setq org-display-inline-images t) | |
(setq org-redisplay-inline-images t) | |
(setq org-startup-with-inline-images "inlineimages") | |
(setq default-frame-alist | |
(append (list '(width . 72) '(height . 40)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; ------------------------------------------------------------------- | |
;; A proof of concept for a multi header or mode line | |
;; | |
;; Multi line header or mode line is made possible by generating an | |
;; SVG image made of two small lines of text. It is certainly memory | |
;; hungry but it seems to be fast enough to display line/column while | |
;; typing text. It can probably be extended in a number of ways. | |
;; | |
;; Feel free to modify it for your own needs. | |
;; ------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# Copyright (c) 2016, Nicolas P. Rougier | |
# Distributed under the (new) BSD License. | |
# ----------------------------------------------------------------------------- | |
import sys, math | |
def progress(value, length=40, title = " ", vmin=0.0, vmax=1.0): | |
""" | |
Text progress bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def binomial(n, k): | |
""" | |
A fast way to calculate binomial coefficients by Andrew Dalke. | |
See http://stackoverflow.com/questions/3025162/statistics-combinations-in-python | |
""" | |
if 0 <= k <= n: | |
ntok = 1 | |
ktok = 1 | |
for t in xrange(1, min(k, n - k) + 1): | |
ntok *= n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 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. |