Skip to content

Instantly share code, notes, and snippets.

View customcommander's full-sized avatar
🇺🇦
I stand with Ukraine

Julien Gonzalez customcommander

🇺🇦
I stand with Ukraine
  • London, UK
View GitHub Profile
@tomconnors
tomconnors / user.clj
Created July 9, 2025 18:23
core.async.flow examples
;; There are some patterns with c.a.flow that weren't immediately obvious to me so I made this gist to
;; figure them out.
;; Those patterns are:
;; - backpressure across processes
;; - long-running tasks
;; - getting inputs for the first process in the flow
(require '[clojure.core.async :as async]
'[clojure.core.async.flow :as flow]
'[clojure.pprint :as pp]
@irwansyahwii
irwansyahwii / PlantUMLGrammar.md
Last active November 14, 2021 10:20
PlantUML Grammar
statement -> element_expr:*  {% id %}
	| null {% id %}

element_expr -> actor_expr {% id %}
	| boundary_expr  {% id %}
	| call_expr {% id %}
	| participant_expr {% id %}
@jonico
jonico / Jenkinsfile
Last active March 5, 2025 22:51
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8
@kennyjwilli
kennyjwilli / defspec-test.clj
Created November 5, 2016 01:37
clojure.spec.test integration with clojure.test
(defmacro defspec-test
([name sym-or-syms] `(defspec-test ~name ~sym-or-syms nil))
([name sym-or-syms opts]
(when t/*load-tests*
`(def ~(vary-meta name assoc :test `(fn []
(let [check-results# (clojure.spec.test/check ~sym-or-syms ~opts)
checks-passed?# (every? nil? (map :failure check-results#))]
(if checks-passed?#
(t/do-report {:type :pass
:message (str "Generative tests pass for "
@Avaq
Avaq / combinators.js
Last active May 20, 2025 01:53
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@kilfu0701
kilfu0701 / extract_cert.sh
Last active June 3, 2020 23:34
Extract certificates from Safari Extension. (MacOS 10.10.x)
## in command line
whereis xar
# > /usr/bin/xar
xar --version
# > xar 1.7dev
## check if there's '--extract-cert' option ?
xar -h
@divarvel
divarvel / continuation.js
Last active May 27, 2023 08:12
implementation of the continuation monad in JS
console.log("\033[39mRunning tests…");
function assertEquals(actual, expected, description) {
if(typeof actual === "undefined") {
console.error("\033[31m" + description + " not implemented\033[39m");
} else {
if(actual !== expected) {
console.error("\033[31m" + description + " failed, expected " + expected + ", got " + actual + "\033[39m");
} else {
console.log(description + " \033[32m ok\033[39m");
}
@john2x
john2x / 00_destructuring.md
Last active June 13, 2025 13:00
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@staltz
staltz / introrx.md
Last active July 28, 2025 11:58
The introduction to Reactive Programming you've been missing
TY - JOUR
TI - Unions, Norms, and the Rise in U.S. Wage Inequality
AU - Western, Bruce
AU - Rosenfeld, Jake
T2 - American Sociological Review
AB - From 1973 to 2007, private sector union membership in the United States declined from 34 to 8 percent for men and from 16 to 6 percent for women. During this period, inequality in hourly wages increased by over 40 percent. We report a decomposition, relating rising inequality to the union wage distribution’s shrinking weight. We argue that unions helped institutionalize norms of equity, reducing the dispersion of nonunion wages in highly unionized regions and industries. Accounting for unions’ effect on union and nonunion wages suggests that the decline of organized labor explains a fifth to a third of the growth in inequality—an effect comparable to the growing stratification of wages by education.
DA - 2011///
PY - 2011
DO - 10.1177/0003122411414817
DP - Highwire 2.0