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
["development", "test", "ci"].each do |databaseName| | |
namespace databaseName do | |
desc "stop" | |
task "stop" do |t| | |
puts "Action stop would now be performed on database #{t.scope}" | |
end | |
end | |
end |
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
# Supporting class for demo purposes | |
class DatabaseStub | |
attr_reader :name | |
def self.instances | |
["development", "test", "ci"] | |
end | |
def initialize(databaseName) | |
@name = databaseName |
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
import Data.List | |
data Point = Point Int Int deriving Show | |
data Direction = DLeft | |
| DRight | |
| DStraight | |
findPointP :: [Point] -> [Point] | |
findPointP points = sortBy smallestYthenX points | |
where smallestYthenX (Point x1 y1) (Point x2 y2) |
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
tell application "System Events" to if exists process "Adium" then | |
tell application "Adium" | |
set account_list to every account | |
repeat with acc in account_list | |
set stat to status of acc | |
set status type of acc to available | |
set status message of acc to "Available." | |
set autoreply of stat to no | |
end repeat | |
end tell |
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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by libffi configure 3.0.13, which was | |
generated by GNU Autoconf 2.69. Invocation command line was | |
$ .././configure --srcdir=.. --enable-builddir=x86_64-apple-darwin11.4.2 --disable-static --disable-dependency-tracking --prefix=/nix/store/4qzrm4946gy3av9wy04n8v3ljzzx3flh-libffi-3.0.13 | |
## --------- ## | |
## Platform. ## |
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
(org-add-link-type "twittering" 'twittering-org:open) | |
(add-hook 'org-store-link-functions 'twittering-org:store-link) | |
(defun twittering-org:open (id-str) | |
(twittering-visit-timeline (concat ":single/" id-str))) | |
(defun twittering-org:store-link () | |
"Store a link to a tweet." | |
(when (and (twittering-buffer-p) (twittering-get-id-at)) | |
(let ((status (twittering-find-status (twittering-get-id-at)))) | |
(apply 'org-store-link-props |
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/evn python | |
# | |
# Rough but serviceable Standard Bank South Africa PDF statement to CSV extraction. | |
# Exports to Xero's import format | |
# | |
# Needs: | |
# - poppler | |
# - lxml for python to be installed (pip install lxml) | |
from lxml import etree as ET |
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
import csv | |
def invert(filename): | |
with open(filename + ".csv", "rb") as csvfile: | |
reader = csv.reader(csvfile, delimiter=",", quotechar='"') | |
with open(filename + "_inverted.csv", "wb") as csvfilew: | |
writer = csv.writer(csvfilew, delimiter=",", quotechar='"', quoting=csv.QUOTE_ALL) | |
first_done = False | |
for row in reader: | |
if first_done: |
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
(def ^:private make-boring-regex #"[*.?!:+-]") | |
(defn sql-name | |
"Makes `kw` a SQL-safe string. | |
/ becomes __ | |
All other SQL-unsafe chars become _" | |
[kw] | |
(let [name-xf (clojure.string/replace (name kw) make-boring-regex "_")] | |
(if (namespace kw) | |
(let [ns-xf (clojure.string/replace (namespace kw) make-boring-regex "_")] |
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
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{ | |
default: Turndown | |
}, { | |
default: Readability | |
}]) => { | |
/* Optional vault name */ | |
const vault = ""; | |
/* Optional folder name such as "Clippings/" */ |