Skip to content

Instantly share code, notes, and snippets.

@borkdude
borkdude / script.clj
Last active October 29, 2020 02:23
Spec grep: find usages or reify in clojure.core with two or more interfaces. This idea has been implemented in a library now: https://github.com/borkdude/grasp
;; see https://github.com/borkdude/grasp for a more elaborate implementation
(ns script
(:require [clojure.java.io :as io]
[clojure.pprint :refer [pprint]]
[edamame.core :as e]))
(def clojure-core (slurp (io/resource "clojure/core.clj")))
(def parsed (e/parse-string-all clojure-core
{:all true :auto-resolve '{:current clojure.core}}))
@borkdude
borkdude / PR welcome.md
Last active February 2, 2021 21:54
PR welcome

Issues that welcome community contributions are labeled with PR welcome. That doesn't mean I don't welcome contributions for other issues. Feel free to reach out and discuss on Clojurians Slack or Github if you need assistance. Please note that I do not have the time or resources to give free and unlimited Clojure mentoring.

See issues

See issues

@borkdude
borkdude / assoc_pairs.clj
Last active April 6, 2021 11:38
Reports number of used k/v pairs in assoc to gather data for https://clojure.atlassian.net/browse/CLJ-1656
#!/usr/bin/env bash
#_" -*- mode: clojure; -*-"
#_(
"exec" "clojure" "-Sdeps" "{:deps {borkdude/grasp {:git/url \"https://github.com/borkdude/grasp\" :sha \"6315cea8c0b6dafc7b1eef9ccd03d6d5590d2045\"}}}" "-M" "$0" "$@"
)
(require '[clojure.java.io :as io]
'[clojure.spec.alpha :as s]
'[clojure.string :as str]
'[grasp.api :as g])
(use ./build/jaylib)
(set-config-flags
:msaa-4x-hint)
(init-window 800 600 "Chart")
(init-audio-device)
(set-target-fps 60)
(def current-animations @{})
@bakpakin
bakpakin / utf8.janet
Last active January 19, 2022 11:34
Use pegs to parse utf8
###
### utf8.janet
###
### Pure janet utf8 utils. You should probably just use C.
###
(defn utf8-encode
"Convert a sequence of codepoints to a string."
[x]
(def buf @"")
@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.
@giner
giner / fix_ibus-mozc.sh
Last active April 8, 2023 08:04
JAPANESE: Make ibus-mozc remember last used mode
# Make ibus-mozc remember the last used mode (e.g. hiragana) and not switch back to Alphabet on restart
# See https://github.com/google/mozc/issues/381
cd $(mktemp -d)
apt source ibus-mozc
cd mozc-*/
patch src/unix/ibus/property_handler.cc << 'EOF'
--- src/unix/ibus/property_handler.cc.orig 2020-10-28 17:21:18.000849932 +0900
+++ src/unix/ibus/property_handler.cc 2020-10-28 17:21:34.172696046 +0900
@@ -80,7 +80,7 @@
@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.
@mgarratt
mgarratt / conjure.md
Last active May 28, 2023 06:39
Conjure Clojure Cheatsheet

nREPL

Binding Action
<localleader>cd Disconnect from the current nREPL server.
<localleader>cf Connect to a server using the port found in any of the files specified by clojure.nrepl/connection.port-files.
<localleader>sc Clone the current nREPL session.
<localleader>sf Create a fresh session from scratch.
<localleader>sq Close the current session.
<localleader>sQ Close all sessions.
\sl List all sessions.
@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"}}}