Skip to content

Instantly share code, notes, and snippets.

@yogthos
yogthos / clojure-beginner.md
Last active April 15, 2024 17:11
Clojure beginner resources

Introductory resources

@defndaines
defndaines / sqlite.cljs
Last active March 19, 2024 22:35
Attempt to Use SQLite3 from ClojureScript
;; Attempting to access an SQLite DB from Loom.
;; SQLite3 is installed and npm installed.
(def sqlite (js/require "sqlite3"))
(defn on-error [err]
(when err
(js/console.error err.message)))

How Clojure's documentation can leapfrog other languages

Summary

I made a documentation generator that cashes in on Clojure's dynamism. See the play-cljs docs (a ClojureScript game library) for an example of its output.

The Problem

Like many of you, I've often wondered what my final regret will be on my deathbed. My best guess came to me in a dream recently. I was walking across the charred earth of an apocalyptic future world, maneuvering around the remains of the less fortunate. I was startled to find a young girl, barely holding onto her life. She murmured something to me. I asked her to repeat it, and she said more loudly: "I...wish your Clojure projects didn't have such crappy documentation."

@ngm
ngm / packages.el
Last active November 13, 2019 21:44
Basic spacemacs org-brain layer
;; put this file in ~/.emacs.d/private/org-brain
;; then add org-brain into your dotspacemacs-configuration-layers in .spacemacs
(defconst org-brain-packages
'(org-brain)
)
;; see https://github.com/Kungsgeten/org-brain#setup-and-requirements
(defun org-brain/init-org-brain ()
(use-package org-brain
@remvee
remvee / time.cljs
Last active June 25, 2022 00:34
Calculate week number in clojurescript
(defn week-number
"Week number according to the ISO-8601 standard, weeks starting on
Monday. The first week of the year is the week that contains that
year's first Thursday (='First 4-day week'). The highest week number
in a year is either 52 or 53."
[ts]
(let [year (.getFullYear ts)
month (.getMonth ts)
date (.getDate ts)
day (.getDay ts)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 16, 2024 14:02
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname