Skip to content

Instantly share code, notes, and snippets.

View jcf's full-sized avatar
❤️

James Conroy-Finn jcf

❤️
View GitHub Profile
@jackrusher
jackrusher / webdav.clj
Last active November 1, 2023 22:07
A minimal webdav server/synthetic filesystem that works with JVM Clojure and babashka. See comments for instructions!
(ns webdav
(:require [clojure.string :as str]
[clojure.data.xml :as xml]
[org.httpkit.server :as hk-server]))
;; add the XML namespace that we'll use later
(xml/alias-uri 'd "DAV:")
(defn dissoc-in
"Should be in the standard library..."
@dustingetz
dustingetz / crud.cljc
Last active February 20, 2022 02:06
100 LOC crud app
(ns user.blog-100-loc-crud-app
"Concrete minimum viable crud app that demonstrates strong composition and real world edge cases"
(:require
[clojure.spec.alpha :as s]
#?(:clj [datomic.api :as d])
[hyperfiddle.api :as hf]
[hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.html5 :as-alias html]))
@GDsouza
GDsouza / keymap.c
Last active July 26, 2023 08:22
Ploopy (momentary) drag scroll keymap
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* Copyright 2019 Sunjun Kim
* Copyright 2020 Ploopy Corporation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@fauxpark
fauxpark / applefn.patch
Last active April 3, 2024 05:29
QMK Apple Fn
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index 18f8b0bbfc..4ef3e230e4 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -878,6 +878,10 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes)
endif
endif
+ifeq ($(strip $(APPLE_FN_ENABLE)), yes)
+ OPT_DEFS += -DAPPLE_FN_ENABLE
@stuarthalloway
stuarthalloway / missing_keys_specs.clj
Created October 14, 2017 11:44
I think it would be a mistake to introduce temporal coupling to prevent typos.
;; I think it would be a mistake to introduce temporal coupling to prevent typos.
;; The example program below lets you identify "missing" keys specs at
;; the time and place of your choosing, and then handle them as you
;; deem appropriate, without imposing those decisions on other
;; users of spec.
(require '[clojure.spec.alpha :as s]
'[clojure.set :as set])
#!/bin/sh
# in case it's already installled
vagrant plugin uninstall vagrant-libvirt
# vagrant's copy of curl prevents the proper installation of ruby-libvirt
sudo mv /opt/vagrant/embedded/lib/libcurl.so{,.backup}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4{,.backup}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4.4.0{,.backup}
sudo mv /opt/vagrant/embedded/lib/pkgconfig/libcurl.pc{,.backup}
@bhb
bhb / test_helper.clj
Last active March 6, 2019 10:51
Test helpers when using clojure.spec
(ns foo.test-helper
(:require [clojure.spec :as s]
[clojure.spec.test :as st]
[clojure.string :as str]
[clojure.test :refer :all]
[clojure.test.check.generators :as gen]
[clojure.test.check.random :refer [IRandom]]
[clojure.test.check.rose-tree :as rose]))
(defn instrument-all
@mohamed-el-habib
mohamed-el-habib / gist:00deef599e8ba1cdbece
Last active September 6, 2016 10:11 — forked from abs/gist:c0d598996870dda719b3
Downloads and installs the startssl CA certs into the global Java keystore
#!/bin/bash
# Downloads and installs the startssl CA certs into the global Java keystore
# https://sipb.mit.edu/doc/safe-shell/
set -euf -o pipefail
# Check if JAVA_HOME is set
if [ "$JAVA_HOME" = "" ]
then
echo "ERROR: JAVA_HOME must be set."
exit 1
@rauhs
rauhs / om.next+pedestal+transit.clj
Last active December 10, 2017 17:08
Om.next tempid handling for pedestal. Interceptors.
(ns srs-s.routes.core
(:require [io.pedestal.http :as pedestal]
[io.pedestal.http.route.definition :refer [defroutes]]
[io.pedestal.interceptor.helpers :as interceptor]
[io.pedestal.http.body-params :as body-params]
[ring.util.response :as ring-response]
[cognitect.transit :as transit]
[om.next.server :as om]
[om.tempid :as tempid])
(:import [java.io OutputStream]