Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.
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 "iTerm" | |
activate | |
-- Close the first session | |
terminate the first session of the first terminal | |
-- New Terminal | |
set myterm to (make new terminal) | |
tell myterm | |
-- Tab 1 (Server) | |
launch session "Default" |
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
# Depends on working pdftk, gm (GraphicsMagick), and pdftotext (Poppler) commands. | |
# Splits a pdf into batches of N pages, creates their thumbnails and icons, | |
# as specified in the Job options, gets the text for every page, and merges | |
# it all back into a tar archive for convenient download. | |
# | |
# See <tt>examples/process_pdfs_example.rb</tt> for more information. | |
class ProcessPdfs < CloudCrowd::Action | |
# Split up a large pdf into single-page pdfs. Batch them into 'batch_size' | |
# chunks for processing. The double pdftk shuffle fixes the document xrefs. |
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
var BASE64_MARKER = ';base64,'; | |
function convertDataURIToBinary(dataURI) { | |
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length; | |
var base64 = dataURI.substring(base64Index); | |
var raw = window.atob(base64); | |
var rawLength = raw.length; | |
var array = new Uint8Array(new ArrayBuffer(rawLength)); | |
for(i = 0; i < rawLength; i++) { |
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
;; Datomic example code | |
(use '[datomic.api :only (db q) :as d]) | |
;; ?answer binds a scalar | |
(q '[:find ?answer :in ?answer] | |
42) | |
;; of course you can bind more than one of anything | |
(q '[:find ?last ?first :in ?last ?first] | |
"Doe" "John") |
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 playbook has been removed as it is now very outdated. |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
from datetime import datetime, date | |
from sqlalchemy.orm.query import Query | |
def render_query(statement, bind=None): | |
""" | |
Generate an SQL expression string with bound parameters rendered inline | |
for the given SQLAlchemy statement. | |
WARNING: This method of escaping is insecure, incomplete, and for debugging | |
purposes only. Executing SQL statements with inline-rendered user values is |
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
(defn delete-recursively [fname] | |
(let [func (fn [func f] | |
(when (.isDirectory f) | |
(doseq [f2 (.listFiles f)] | |
(func func f2))) | |
(clojure.java.io/delete-file f))] | |
(func func (clojure.java.io/file fname)))) |
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
; using https://code.google.com/p/language-detection/ | |
; i.e. [com.cybozu.labs/langdetect "1.1-20120112"] | |
(require '[clojure.java.io :as io]) | |
(->> #{"af" "ar" "bg" "bn" "cs" "da" "de" "el" "en" "es" "et" "fa" "fi" "fr" "gu" | |
"he" "hi" "hr" "hu" "id" "it" "ja" "kn" "ko" "lt" "lv" "mk" "ml" "mr" "ne" | |
"nl" "no" "pa" "pl" "pt" "ro" "ru" "sk" "sl" "so" "sq" "sv" "sw" "ta" "te" | |
"th" "tl" "tr" "uk" "ur" "vi" "zh-cn" "zh-tw"} | |
(map (partial str "profiles/")) |
OlderNewer