Skip to content

Instantly share code, notes, and snippets.

@jjrdn
jjrdn / dump.clj
Created October 22, 2017 06:49 — forked from puredanger/dump.clj
Dumping a var meta table
;; Prints a table of vars in an ns with name/line/added/macro flag/deprecated flag
(defn pr-vars [ns-sym]
(->> (ns-publics ns-sym) vals (map meta) (sort-by :name)
(map #(select-keys % [:name :line :added :macro :deprecated]))
(map #(merge {:added nil :macro false :deprecated false} %))
clojure.pprint/print-table))
(pr-vars 'clojure.string)
;; | :added | :macro | :deprecated | :name | :line |
#! /usr/bin/env python
from boto.ses.connection import SESConnection
import os
import sys
import subprocess
import socket
TMPFILE = '/var/run/postgresql/last-wal-archive-error-file.tmp'
if __name__ == '__main__':
@jjrdn
jjrdn / bc
Created April 20, 2014 22:34 — forked from rnorth/bc
#!/bin/bash
# Sends a Boxcar push notification through the Boxcar HTTP API
# Usage examples
# $ bc # Just sends a notification with title 'bc'
# $ bc "Done" # Sends a notification with title 'Done'
# $ echo foobar | bc # Sends a notification with title 'bc' and message body 'foobar'
# $ echo foobar | bc "Done" # Sends a notification with title 'Done' and message body 'foobar'
#
# Expects a file ~/.boxcar to exist with content like
## Adding ,noatime,nodiratime
/dev/sda / ext4 errors=remount-ro,noatime,nodiratime 0 1
@jjrdn
jjrdn / advice.js
Created August 17, 2013 19:33 — forked from angus-c/advice.js
//usage
withAdvice.call(targetObject);
//mixin augments target object with around, before and after methods
//method is the base method, advice is the augmenting function
withAdvice: function() {
['before', 'after', 'around'].forEach(function(m) {
this[m] = function(method, advice) {
if (typeof this[method] == 'function') {
return this[method] = fn[m](this[method], advice);
@jjrdn
jjrdn / index.html
Last active December 14, 2015 20:28 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
float: left;
border: solid 1px #aaa;
}
</style>