Skip to content

Instantly share code, notes, and snippets.

View Rovanion's full-sized avatar

Rovanion Luckey Rovanion

View GitHub Profile
@Rovanion
Rovanion / utils.ts
Created April 17, 2018 09:19
A semitransparent print or log function for TypeScript or JavaScript
let fnNameMatcher = /([^(]+)@|at ([^(]+) \(/;
function fnName(str: string) {
let regexResult = fnNameMatcher.exec(str) as string[];
if (regexResult) {
return regexResult[1] || regexResult[2];
} else { return ''; }
}
export function log(...messages: any[]) {
@Rovanion
Rovanion / rewrite-history.sh
Created April 25, 2018 14:12
Rewrite git history
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="a@example.com
CORRECT_NAME="a"
(defun elisp-showdoc (f)
(interactive (list (thing-at-point 'symbol t)))
(message
"%s"
(let* ((doc-list (split-string (documentation (intern f)) "\n"))
(number-lines (min (- (floor (* max-mini-window-height (frame-height))) 2)
(- (length doc-list) 2)))
(subset (concatenate 'list
(last doc-list)
'("")
(ns tove.specs.generators
"Based on https://github.com/dm3/clojure.joda-time/blob/master/test/joda_time/generators.clj"
(:require [clojure.test.check.generators :as gen]
[clojure.string :as string]
#?(:clj [java-time :as jt]
:cljs [cljs-time.core :as jst]))
#?(:clj (:import [java.time LocalDate LocalDateTime ZonedDateTime]
[java.time.chrono IsoChronology])))