Skip to content

Instantly share code, notes, and snippets.

View wavejumper's full-sized avatar
👽

Thomas Crowley wavejumper

👽
View GitHub Profile
@wavejumper
wavejumper / sente-ring-jetty9-adapter-example.clj
Last active August 9, 2021 09:20 — forked from ptaoussanis/sente-ring-jetty9-adapter-example.clj
Example of how to use Sente and Jetty 9 via `ring-jetty9-adapter`
;; Example courtesy of @wavejumper
(ns sente-ring-jetty9-adapter-example
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :as ring.defaults :refer [wrap-defaults]]
[ring.middleware.session.memory :as mem]
[ring.adapter.jetty9 :as jetty]
[taoensso.sente :as sente]
[taoensso.sente.server-adapters.jetty9 :as adapters.jetty9]))

React Native + macOS + Clojurescript

image

Project Catalyst

Since the recent release of Catalina, macOS has shipped with the ability to allow iOS/iPAD apps to run on macOS without any modification via a featureset known as Project Catalyst.

This is exciting, as writing React Native + Clojurescript apps as a target for the desktop is much more compelling than a pure Electron app (imo).

{:seat-tube {:length 560
:angle 73}
:top-tube {:length 580}
:head-tube {:length 220
:angle 73}
:chainstay {:length 435}
:bottom-bracket {:drop 65}
:fork {:length 396
:rake 70}}
[(['if cond truthy-expr] :seq)]
(do (lint! (lint/refactor expr `(when ~cond ~truthy-expr)))
(eval-expr `(if ~cond ~truthy-expr nil)))
(ns static.core-test
(:require [clojure.test :refer :all]
[static.core :as s]))
(defmacro with-env [eval-sym & body]
`(let [env# (s/create-env)
~eval-sym (partial s/-eval env#)]
~@body))
(deftest scoping
module slit () {
translate([0,10,0]) { cube([4,30,15], true); }
}
module bolt(height, dia) {
rotate([0,90,0]) {
cylinder(h=height, d=dia, center=true);
}
}
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
Show: Clojure Java REPL Tooling Duplicates All (21 frames hidden)
1. Unhandled clojure.lang.ExceptionInfo
Value does not match schema: {:a (not (= :b :c)), :b
missing-required-key}
{:type :schema.core/error,
:schema
{:a {:v :b},
:b [java.lang.String],
@wavejumper
wavejumper / gist:ed92bf6fb542f7e9dff6
Created February 15, 2015 07:22
observe-ring.clj
(ns foo.core
(:require [clojure.core.match :refer (match)]
[compojure.core :refer :all]))
(defn metrics [req resp]
(match [req resp]
[{:uri "/login"} {:status 401}]
(println "Failed login")
[{} {:status 500}]