Skip to content

Instantly share code, notes, and snippets.

@wu-lee
wu-lee / .editorconfig
Last active September 2, 2023 09:53 — forked from ErikGartner/.treehouse
dTree Demo
# Cross-platform formatting config
# See https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
@wu-lee
wu-lee / concepts.nim
Created March 24, 2018 10:33 — forked from PhilipWitte/concepts.nim
How to use concept in Nim
type
CanDance = concept x
dance(x) # `x` is anything that has a `dance` procedure
proc doBallet(dancer: CanDance) =
# `dancer` can be anything that `CanDance`
dance(dancer)
# ---
;; FIXME work in progress
;; ----------------------------------------------------------------------
;; Gets a cons cell indicating the bounds of the current region (if set) or word
(defun bounds-of-word-or-region ()
(if (and transient-mark-mode mark-active)
(cons (region-beginning) (region-end))
(bounds-of-thing-at-point 'symbol)))
;; ----------------------------------------------------------------------