Skip to content

Instantly share code, notes, and snippets.

View andersmurphy's full-sized avatar

Anders Murphy andersmurphy

View GitHub Profile
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
metosin/reitit {:mvn/version "0.6.0"}
info.sunng/ring-jetty9-adapter {:mvn/version "0.30.0"}
http-kit/http-kit {:mvn/version "2.7.0"}}
:aliases
{:dev {:jvm-opts ["--enable-preview"]}
:run {:exec-fn server/go
:exec-args {}}}}
@alexander-yakushev
alexander-yakushev / deps.edn
Last active September 4, 2023 12:56
System-wide tools.deps configuration and code (for London Clojurians meetup 05'23)
{:deps {org.clojure/clojure {:mvn/version "1.12.0-alpha3"}}
:aliases {:dev {:extra-deps
{com.clojure-goes-fast/clj-async-profiler {:mvn/version "1.0.4"}
com.clojure-goes-fast/clj-java-decompiler {:mvn/version "0.3.4"}
com.clojure-goes-fast/clj-memory-meter {:mvn/version "0.3.0"}}
:jvm-opts ["-Djdk.attach.allowAttachSelf"
"-XX:+UseG1GC"
"-XX:-OmitStackTraceInFastThrow"
@dustingetz
dustingetz / electric-references.md
Last active July 27, 2023 13:39
Reference list — Electric Clojure

References — Electric Clojure

Electric Clojure implements a form of arrowized continuous time dataflow programming with extensions for network-transparent function composition.

@zk
zk / index.md
Last active July 29, 2023 12:11
redbean single-file distributable web server: how to edit as archive in emacs

Hack to edit redbean files as archives in Emacs

Redbean is an insanely cool ball of hacks that result in a single binary webserver that is fast, contains a dynamic language interpreter (Lua), and can serve files out of itself by acting like a zip file. Mind blowing.

Unfortunately Emacs' archive-mode, which allows you to manipulate the files in a zip as if it were a filesystem tree doesn't know how to open redbean files.

Here's a quick hack to enable this:

  1. Download redbean curl https://redbean.dev/redbean-latest.com >redbean.com
  2. Open in Emacs emacs ./redbean.com
@prestancedesign
prestancedesign / web.clj
Last active August 24, 2023 15:45
Ring session authentication with Reitit
(ns authexample.web
(:gen-class)
(:require [buddy.auth :refer [authenticated? throw-unauthorized]]
[buddy.auth.backends.session :refer [session-backend]]
[buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]
[clojure.java.io :as io]
[compojure.response :refer [render]]
[reitit.ring :as ring]
[ring.adapter.jetty :as jetty]
[ring.middleware.params :refer [wrap-params]]
@jacobobryant
jacobobryant / data-readers.md
Last active March 25, 2022 16:06
refreshing namespaces breaks *data-readers*

If you call clojure.tools.namespace.repl/refresh before requiring any namespaces referenced in data_readers.clj, then *data-readers* gets messed up somehow. The readers you define in data_readers.clj won't work even if you require their namespaces. For example:

$ find -type f
./src/foo/core.clj
./src/data_readers.clj
./src/user.clj
@omgmog
omgmog / dialog.p8
Last active August 5, 2023 06:24
Dialog system for Pico-8
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
function sleep(s)
for i=1,s*30 do
flip()
end
end
@josefnpat
josefnpat / readme.md
Last active April 7, 2024 11:39
Going from Lua 5.2 to PICO-8's Lua

This information applies to the PICO-8 0.1.6 release.

This document is here to help folks with a proficiency in Lua understand the limitations and discrepencies between Lua and PICO-8's Lua.

You can always view the manual or yellowafterlife's extended 0.1.1 manual.

General

  • anything written in uppercase the PICO-8 editor or .p8 is made lowercase by the editor. → editing the .p8 file directly can work
  • print(function() end) outputs the string function instead of the string function: 0x0000000.
@allgress
allgress / reagent_datascript.cljs
Last active February 16, 2023 21:16
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))