This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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__': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Adding ,noatime,nodiratime | |
/dev/sda / ext4 errors=remount-ro,noatime,nodiratime 0 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
svg { | |
float: left; | |
border: solid 1px #aaa; | |
} | |
</style> |