Skip to content

Instantly share code, notes, and snippets.

View 01_content
Don't allow eel bearing Atlanteans into your country; economic ruin follows close behind
jmorton / typography.scss
Created Apr 3, 2019
Harmonic type scaling
View typography.scss
$t1: 0.8706rem;
$t2: 1.0rem;
$t2: 1.1487rem;
$t3: 1.3195rem;
$t4: 1.5157rem;
$t5: 1.7411rem;
$t6: 2.0rem;
$line-spacing: 1.5rem;
View dabblet.css
* SVG tracer
body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
import pika
import msgpack
import logging
import sys
from . import spark
from .app import logger
logger = logging.getLogger(__name__)
View docker-compose.yml
version: "2"
image: cassandra:3.9
network_mode: host
- ./volumes/cassandra/var:/var/lib/cassandra
image: zookeeper:3.4.9
network_mode: host
View numberize.clj
(defmulti numberize (fn [n] (type n)))
(defmethod numberize :default [n]
(defmethod numberize Number [number]
(defmethod numberize String [string]
(let [number-format (java.text.NumberFormat/getInstance)]
View scrape.clj
(ns scrape.core
(:require [clojure.edn :as edn]
[org.httpkit.client :as client]
[net.cgrand.enlive-html :as html]))
(defn get-links
"Get all links at URL as absolute URLs."
(->> ;; first get all <a href="">...</a> elements...
(-> ( url)
jmorton / snap.clj
Last active Jan 13, 2017
Point snapping function
View snap.clj
(defn offset
"Calculate distance between point and nearest tile pixel"
[point pixel-size tile-pixel-count]
(mod point (* pixel-size tile-pixel-count)))
(defn near
"Find nearest point"
[point interval shift]
(-> point
(- shift)
View accept-handler.clj
(defn parse-quality
"Convert the first 'q' parameter to a number (or 1.0)"
(let [[_ qvalue] (re-find #";q=([0-9\.]+)" (or extension ""))]
(java.lang.Double. (or qvalue "1.0"))))
(defn +media-range
(->> (re-find #"(([\w\*]+)/([^;]+))(;.*)?" accept)
jmorton /
Last active Jun 8, 2016
My LCMAP Setup Script [WIP]
## Preliminaries
apt-get install git curl
## Java
echo "Installing JDKs"
add-apt-repository ppa:webupd8team/java -y
apt-get update -qq
apt-get install oracle-java7-installer