Skip to content

Instantly share code, notes, and snippets.

View will-henney's full-sized avatar

William Henney will-henney

  • IRyA, UNAM
  • Morelia, Michoacán, Mexico
View GitHub Profile
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 9, 2024 19:08
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@fuxialexander
fuxialexander / katex.el
Last active April 12, 2018 17:03
Instant latex preview in org mode
;; (org-inside-LaTeX-fragment-p)
(require 'xwidget)
(defvar katex-url "file:///PATH/TO/katex.html?")
(defvar katex-buffer nil)
(defvar katex-xw nil)
(setq katex-buffer (get-buffer-create "*xwidget webkit: Katex *"))
(defun org-katex-latex-fragment-maybe (&optional arg)
"TODO"
(if (org-inside-LaTeX-fragment-p)
@tmalsburg
tmalsburg / predict_vs_simulate.org
Last active November 18, 2022 01:14
Predict vs simulate in lme4

Predict vs simulate in lme4

For this investigation we are going to use the sleepdata data set from the lme4 package. Here is the head of the data frame:

;; grep -h X-Key */*/cur/* | sed -e 's/X-Keywords: //; s/, /\n/g' | sort | uniq > xkeys.txt
(setq mu4e-xkeys "~/Maildir/xkeys.txt")
(defun read-lines (f)
"Return a list of lines of a file at f."
(with-temp-buffer
(insert-file-contents f)
(split-string (buffer-string) "\n" t)))
@bradwright
bradwright / path.el
Created March 15, 2012 20:13
Set Emacs exec-path by shell $PATH
;; This sets the Emacs "PATH" environment variable and the `exec-path`
;; variable to the same value your login shell sees. The reason this
;; is necessary is because of this:
;;
;; http://developer.apple.com/library/mac/#qa/qa1067/_index.html
;;
;; Basically apps launched from Finder inherit their environment from
;; a .plist file rather than the shell environment.
(defun set-exec-path-from-shell-PATH ()