Skip to content

Instantly share code, notes, and snippets.

@r-moeritz
r-moeritz / pretty-literals.lisp
Created June 24, 2011 10:30
pretty hash table & vector literal syntax for common lisp
;;;; pretty-literals.lisp - pretty hash table & vector literal syntax
;;;; inspired by and uses code from http://frank.kank.net/essays/hash.html
(in-package #:pretty-literals)
;; vector literal syntax using brackets
(set-macro-character #\[
(lambda (str char)
(declare (ignore char))
(let ((*readtable* (copy-readtable *readtable* nil))
@daveray
daveray / seesaw-repl-tutorial.clj
Created December 7, 2011 04:55
Seesaw REPL Tutorial
; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.
@reborg
reborg / rich-already-answered-that.md
Last active February 23, 2024 13:09
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@dubrowgn
dubrowgn / move-copy-borrow.md
Last active September 14, 2023 13:54
Move, Copy, Borrow

Move/Copy/Borrow Semantics in Programming

Or, ramblings and complaints about the general state of programming and other possibly related grievances.

There are 3 primary ways to pass data into functions: move, copy, or borrow (aka a reference). Since mutability is inherently intertwined with data passing (this function can borrow my data, but only if they promise not to mess with it), we end up with 6 distinct combinations.

Move, Copy, Borrow, Mutable, Immutable

Every language has its own level of support and take on these semantics:

@SKempin
SKempin / Git Subtree basics.md
Last active April 17, 2024 03:47
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@HendrixString
HendrixString / ansi.md
Last active March 26, 2023 14:09
ANSI 256 color codes resources
echo -e "testing \033[48;5;88mCOLOR1\033[38;208;48;5;159mCOLOR2\033[m"

The color range of a 256 color terminal consists of 4 parts, often 5, in which case you actually get 258 colors:

  • Color numbers 0 to 7 are the default terminal colors, the actual RGB value of which is not standardized and can often be configured.
  • Color numbers 8 to 15 are the "bright" colors. Most of the time these are a lighter shade of the color with index - 8. They are also not standardized and can often be configured. Depending on terminal and shell, they are often used instead of or in conjunction with bold font faces.
  • Color numbers 16 to 231 are RGB colors. These 216 colors are defined by 6 values on each of the three RGB axes. That is, instead of values 0 - 255, each color only ranges from 0 - 5.
@athos
athos / deps.edn
Last active June 21, 2023 00:15
Try on your terminal `clojure -Sdeps '{:deps {hello-clojure/hello-clojure {:git/url "https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202" :git/sha "099bdf7d565b2c35c1df601abf58514cc5276237"}}}' -M -m hello-clojure`
{:paths ["."]
:deps {clansi/clansi {:mvn/version "1.0.0"}}}
@mtnygard
mtnygard / deps.edn
Last active April 9, 2024 11:51 — forked from athos/deps.edn
Friendly REPL. Run with `clojure -Sdeps '{:deps {hello-clojure {:git/url "https://gist.github.com/mtnygard/9b2dd3c88b3309d82210b84f33ee954d" :sha "774314af2d28261af4a52ac270136d5ba21ff046"}}}' -m frenpl`
{:paths ["." "src" "test"]
:deps {expound {:mvn/version "0.8.4"}
clansi {:mvn/version "1.0.0"}
cider/cider-nrepl {:mvn/version "0.24.0"}
refactor-nrepl {:mvn/version "2.5.0"}
com.bhauman/rebel-readline {:mvn/version "0.1.4"}}}
@mikeananev
mikeananev / deps.edn
Created February 24, 2019 22:28
Clojure compress / decompress data examples
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
com.taoensso/nippy {:mvn/version "2.14.0"}
org.apache.commons/commons-compress {:mvn/version "1.18"}}}
@zeux
zeux / luau_features.pdf
Last active May 22, 2023 20:42
Frequently asked questions about the Lua VM work we (Roblox) are doing.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.