Skip to content

Instantly share code, notes, and snippets.

@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active April 18, 2024 14:15
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@ibraheem4
ibraheem4 / postgres-brew.md
Last active April 14, 2024 20:30 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@tmoertel
tmoertel / gist:5798134
Last active April 8, 2024 21:34
How to transform the vanilla recursive fib function into the iterative DP version through a series of mechanical steps.
# Transforming the vanilla recursive fib into the iterative DP version
# through a series of mechanical steps.
#
# For more on converting recursive algorithms into iterative ones, see:
# http://blog.moertel.com/posts/2013-05-11-recursive-to-iterative.html
# original function
def fib(n):

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps.

  1. What is a parser?
  2. and, what is a parser combinator?

So first question: What is parser?

@sgnl
sgnl / postgres-brew.md
Last active February 20, 2024 10:40
Installing Postgres via Brew (OSX) (outdated see top most note)

Outdated note: the process is a lot easier now: after you brew install postgresql you can initialize or stop the daemon with these commands: brew services start postgresql or brew services stop postgresql.

new out put may look like

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start

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."

@danneu
danneu / golang-vs-clojure-async.md
Last active November 6, 2023 04:09
Google I/O 2012 - Go Concurrency Patterns ported to Clojure Video: http://www.youtube.com/watch?v=f6kdp27TYZs
@danielrw7
danielrw7 / replify
Last active October 24, 2023 12:03
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for `%s`\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "%s> " "$command"
@dustingetz
dustingetz / electric-todomvc.md
Last active August 6, 2023 03:30
Photon TodoMVC, with a twist!

TodoMVC, with a twist! — Electric Clojure

  1. it's multiplayer! 0 LOC cost
  2. state is durable! (server side database) 0 LOC cost
  3. See those pending spinners? We've added a server delay to demonstrate managed load states.
20220817.todomvc.mp4

Electric is a "multi tier" Clojure/Script dialect for full-stack web application development. It uses macros to let you interweave client and server code in a single .CLJC file, so you can define a full-stack frontend/backend webapp all in one place. Electric is designed for rich dynamic applications with reactive user interfaces and complex frontend/backend data sync requirements.