Skip to content

Instantly share code, notes, and snippets.

View venantius's full-sized avatar
🏦
Running a bank

David Jarvis venantius

🏦
Running a bank
View GitHub Profile
(ns down-to-zero.core)
(defn factorial
[i n factors]
(if (> i (Math/sqrt n))
;; we've found all the factors, return
factors
(if (zero? (mod n i))
;; this is a factor, add it, increment i, and recurse
(factorial (inc i) n (conj factors i (/ n i)))

Keybase proof

I hereby claim:

  • I am venantius on github.
  • I am venantius (https://keybase.io/venantius) on keybase.
  • I have a public key ASDPkwvzXrEtQJvqg0DQVd6guroo6k5gDFPdHuW6SnrbhAo

To claim this, I am signing this object:

@venantius
venantius / humanize-schema-errors.clj
Created June 24, 2016 17:36 — forked from rauhs/humanize-schema-errors.clj
Translate prismatic's schema.core errors to a human readable form. Use this for presenting validation errors to users. Don't use this for programming errors like a missing map key etc.
(ns x.y
(:use [plumbing.core]) ;; Just for the map-vals
(:require [clojure.walk :refer [postwalk prewalk prewalk-demo postwalk-demo]]
[clojure.core.match :refer [match]]
[schema.utils :refer [named-error-explain validation-error-explain]]
[schema.core :as s])
(:import (schema.utils NamedError ValidationError)))
;; Partially FROM:
;; https://github.com/puppetlabs/clj-schema-tools
@venantius
venantius / styles.less
Created February 17, 2016 19:11 — forked from brandondurham/styles.less
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
@venantius
venantius / gist:ba11dc49cc7a770a3420
Created December 9, 2015 05:09
Rubocop summary stats generator
#!/usr/bin/env python3
"""
A little script to quickly identify the worst offenders. Easily extensible to
find and sort by other issues. Expects you to have results available in an
easily consumable JSON file, which you can generate by running:
rubocop --format progress --format json --out rubocop.json
"""
@venantius
venantius / gist:9f4e9f5d045d7403a1d4
Created December 1, 2015 18:49
Ruby+Rails+Tags
Do this: http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html
@venantius
venantius / core.clj
Last active August 29, 2015 14:16 — forked from urbanautomaton/core.clj
(ns amen.core
(:require [overtone.live :refer :all]))
(def snare (freesound 26903))
(def crash (freesound 26884))
(def ride (freesound 26889))
(def kick (freesound 26888))
(def amen-tabs
[{:sound crash, :tab "----------------|----------------|----------------|----------x-----"}

Welcome!

For feedback or suggestions, please send a tweet (@dideler). Gist comments don't notify me. Pull requests aren't possible with gists (yet), so I don't recommend forking because then I can't easily get the change.

Starring this gist will give me an idea of how many people consider this list useful.


Contents

@venantius
venantius / id_rsa.pub
Last active December 31, 2015 11:39
id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTPTf6x9wldFP3sUPUWYnfAP3yZ9EylaFhqY7Q1w5EU5A5jBlOg9x/4/SkipfwUcVnBawxbHLuoGq3IhCyh83GZl8ORBY7Px3fZS4u2ZAL4vU8Ry7e1VFu2A7HyC48vCZZhT0HP2T89GMOeqizziZXpO6MNwsQ+9r5DjENbfOuKK2sX2Ha+BaHc2NIgGYP8PeOf6GgL6H3d/51OBbFr3IE5ihmaUej4ymyMh6vouDOLWRBUCU6oSHT3GS0wrEZ4xKV1gAaENbXEnKaXpp9Sb+5mJsUwV8+0Tnax3syyUKvjZdOEllBbEaju3B7zdX8WFDt0+AR0aE0+8w5KlIp+QFP jarvis@ws-macbook-pro
@venantius
venantius / venanti.us_nginx
Last active December 29, 2015 06:29
This is how to set up a subdomain reverse proxy
server {
listen 80;
server_name blog.venanti.us;
location / {
proxy_pass http://85.17.164.147:2368;
# This should be changed in the future to send to 127.0.01
# but for now Ghost isn't configured for that
}