Skip to content

Instantly share code, notes, and snippets.

@sogaiu
sogaiu / 0 - data.md
Created January 16, 2019 23:30 — forked from sundarj/0 - data.md
data: towards enlightenment

data

towards enlightenment

‘It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts.’

@sogaiu
sogaiu / save.clj
Last active February 11, 2019 23:54 — forked from saikyun/save.clj
Proto repl save functionality for ClojureCLR + initial docs attempt
(ns miracle.tools.save
(:require [clojure.walk :refer [postwalk]]))
;; usage
;;
;; (save) or (save :whatever) somewhere in a function to save all the local
;; bindings at that point in time.
;;
;; (save-func ...) where ... is the body of your functions (e.g. (defn hej [a]
;; (save-func (let [b 5] (+ a b)))))
@sogaiu
sogaiu / TrueColour.md
Created February 27, 2021 11:52 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@sogaiu
sogaiu / rich-already-answered-that.md
Created April 18, 2021 23:28 — forked from reborg/rich-already-answered-that.md
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

@sogaiu
sogaiu / seesaw-repl-tutorial.clj
Created April 27, 2021 11:17 — forked from daveray/seesaw-repl-tutorial.clj
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.
@sogaiu
sogaiu / pretty-literals.lisp
Created May 3, 2021 09:42 — forked from r-moeritz/pretty-literals.lisp
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))
@sogaiu
sogaiu / audio2midi.md
Created August 15, 2021 04:30 — forked from natowi/audio2midi.md
List of open source audio to midi packages
@sogaiu
sogaiu / luau_features.pdf
Created August 19, 2021 01:29 — forked from zeux/luau_features.pdf
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.
@sogaiu
sogaiu / Git Subtree basics.md
Created March 30, 2022 07:06 — forked from SKempin/Git Subtree basics.md
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:

@sogaiu
sogaiu / move-copy-borrow.md
Created September 14, 2022 18:25 — forked from dubrowgn/move-copy-borrow.md
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: