Skip to content

Instantly share code, notes, and snippets.

View humorless's full-sized avatar

Laurence Chen humorless

View GitHub Profile
@humorless
humorless / clojars.md
Created November 10, 2022 08:34 — forked from hiteshjasani/clojars.md
Clojars instructions

Publish Release

  1. Update version in project.clj
  2. lein deploy clojars

Setup

Project

1. Ensure prefix is on project in project.clj

@humorless
humorless / deps.clj
Created October 31, 2022 10:08 — forked from theronic/deps.clj
Convert Clojure project.clj :dependencies to deps.edn style
; using Clojure 1.9
(require '[clojure.pprint :as pprint])
(defn xform-dep [[lib version & korks]]
(let [args (into {} (apply hash-map korks))]
[lib (merge {:mvn/version version} args)]))
(defn xform-deps
"deps.edn utility function by @theronic 2018-02-28
Transforms a collection of project.clj :dependencies to deps.edn style
@humorless
humorless / core.clj
Created September 15, 2021 03:19 — forked from plexus/core.clj
(ns my-backend.core
(:gen-class)
(:require [compojure.core :as c]
[compojure.route :as route]
[ring.adapter.jetty :as jetty]
[ring.middleware.defaults :as ring-defaults]
[hiccup2.core :as h]
#_[muuntaja.core :as m]
[muuntaja.middleware :as muuntaja]))
@humorless
humorless / datomic-helpers.clj
Created March 19, 2021 16:54 — forked from bobby/datomic-helpers.clj
Some Datomic helpers I sometimes use with ring or pedestal-service apps
(ns datomic-helpers
(:require [datomic.api :as d]))
;;; Expose Datomic vars here, for convenience
;;; Ring middleware
(defn wrap-datomic
"A Ring middleware that provides a request-consistent database connection and
value for the life of a request."
@humorless
humorless / tmux-cheatsheet.markdown
Created June 4, 2020 08:21 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@humorless
humorless / core.clj
Created October 1, 2019 15:52 — forked from roman01la/core.clj
Parsing with clojure.spec
(require '[clojure.spec.alpha :as s])
[:h1 {} "0" 1 [:span]]
(s/def :hiccup/form
(s/or
:string string?
:number number?
:element :hiccup/element))
@humorless
humorless / gist:c0365d8e86396bb9d348ab95e1dcfdbb
Created April 2, 2019 03:15 — forked from stuarthalloway/gist:2645453
Datomic queries against Clojure collections
;; Datomic example code
(use '[datomic.api :only (db q) :as d])
;; ?answer binds a scalar
(q '[:find ?answer :in ?answer]
42)
;; of course you can bind more than one of anything
(q '[:find ?last ?first :in ?last ?first]
"Doe" "John")
@humorless
humorless / README.md
Created March 30, 2019 14:08 — forked from csswizardry/README.md
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
@humorless
humorless / deps.edn
Created April 26, 2018 02:59 — forked from athos/deps.edn
Try `clojure -Sdeps '{:deps {hello-clojure {:git/url "https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202" :sha "1c9a05106171f97f9b8e8ac8f58c7bd8dbe021f9"}}}' -m hello-clojure` on your terminal
{:paths ["."]
:deps {clansi {:mvn/version "1.0.0"}}}
@humorless
humorless / vast3_error_codes.md
Created April 11, 2018 10:42 — forked from rhumlover/vast3_error_codes.md
VAST 3 error codes

VAST Error Codes Table

From VAST 3.0 Spec (PDF)

Code Description
100 XML parsing error.
101 VAST schema validation error.
102 VAST version of response not supported.
200 Trafficking error. Video player received an Ad type that it was not expecting and/or cannot display.