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
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@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."
(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
(ns interop.core
(:require [cljs.nodejs :as nodejs]))
(nodejs/enable-util-print!)
(def Immutable (js/require "immutable"))
(extend-type Immutable.List
ISeqable
(-seq [coll]
@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")))

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:

@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
@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 / starship-names.txt
Last active December 1, 2024 01:09
Spaceship Names
Fantasy Heartbreaker
Vague Aggregate
I’d Ship It
Vargr
Hanzo Main
Horny on Main
Dump Stat
Trap Street
Event Horizon
Cherenkov Blue