Skip to content

Instantly share code, notes, and snippets.

View bonkydog's full-sized avatar

Brian Jenkins bonkydog

  • Nubank
  • SF Bay Area
View GitHub Profile
@sovelten
sovelten / clojure-haskell-macros.md
Created February 5, 2020 20:34
Clojure, Thread Macros, Parameter Order, Function Composition and Other Stuff

Clojure, Thread Macros, Parameter Order, Function Composition and Other Stuff

Introduction

Coming from a Haskell background and landing on Clojure-land, I had a lot of difficulty grasping some design decisions, specially regarding parameter order and the use of threading macros. This post aims to shed a light on some design decisions Clojure took and reason about whether or not, how or when should you use thread macros. This is an entirely personal opinion, but reasonable arguments are given.

Parameter Ordering

@bonkydog
bonkydog / starship-names.txt
Last active May 1, 2024 18:45
Spaceship Names
Fantasy Heartbreaker
Vague Aggregate
I’d Ship It
Vargr
Hanzo Main
Horny on Main
Dump Stat
Trap Street
Event Horizon
Cherenkov Blue
@grahampugh
grahampugh / Disable_macOS_Upgrade_Notifications.sh
Last active October 19, 2021 14:38
Script to prevent the macOS Upgrade Notification popup, or delete it if it's already installed
#!/bin/bash
# Disable macOS Upgrade notifications
# Step 1: prevent the update which brings the notification down
softwareupdate --ignore macOSInstallerNotification_GM
echo
# Step 2: delete the file if it's already on the computer
@bonkydog
bonkydog / apocalypse-names.txt
Last active May 1, 2024 18:46
Apocalypse World Names
Lord Meg
Dodger
Dodgem
Husk
Husker
Dusk
Drain
Clamp
Beetle
Bell

Raise Open File Limits in OS X

in OS X 10.4 to macOS sierra 10.12 and maybe higher!

Create Launcher Script:

/Library/LaunchDaemons/limit.maxfiles.plist

Copy this entire code block and paste it into your terminal and push Return to create this file for you with correct permissions. It will (probably) ask for your password:

@caskolkm
caskolkm / logging.cljc
Last active March 14, 2019 10:31
Simple Clojurescript logging using Google Closure logging tools, now in cljc :)
(ns app.logging
(:refer-clojure :exclude [time])
(:require #?(:clj [clojure.tools.logging :as log]
:cljs [goog.log :as glog]))
#?(:cljs (:import goog.debug.Console)))
#?(:cljs
(def logger
(glog/getLogger "app")))
(ns interop.core
(:require [cljs.nodejs :as nodejs]))
(nodejs/enable-util-print!)
(def Immutable (js/require "immutable"))
(extend-type Immutable.List
ISeqable
(-seq [coll]
(defn listen-file-drop
([el] (listen-file-drop el (chan)))
([el out & {:keys [concat]
:or {concat true}}]
(let [handler (events/FileDropHandler. el true)]
(events/listen el events/FileDropHandler.EventType.DROP
(fn [e] (let [files (event->files e)]
(.log js/console "dropped")
(.log js/console (-> (-source-event e) .-dataTransfer .-files prim-seq))
(if concat
@aphyr
aphyr / gist:aa3de337d12ac886eb96
Created October 9, 2014 23:59
Functional clojure.test
(require '[clojure.test :as test])
; Rewrite clojure.test to generate data structures instead of writing to
; stdout
(def ^:dynamic *results*
"Bound dynamically to an atom wrapping a vector of test report maps")
(defn add-name
"Given a testing report map, assoc's on a :name derived from the current
`clojure.test/testing` context."