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
(define-easy-handler (submission-form :uri "/" :default-request-type :get) () | |
(setf (hunchentoot:content-type*) "text/html") | |
(with-html-output-to-string (s) | |
(:html | |
(:head | |
(:title "File Processor") | |
(:style :rel "stylesheet" :type "text/css" | |
(str (css-lite:css (("body") (:background-color "#666")))))) | |
(:body | |
(:form :action "/process" |
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 | |
# timestamp passed files | |
# by inserting the date into the filename | |
# | |
# The linux `rename` command is great, but it doesn't allow | |
# inserting a consecutive counter into the filename | |
# if there is a conflict. | |
# | |
# Also, there is the amazing Thunar Bulk Rename tool, |
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
// accepts optional transformer | |
// now transformers are compatible with ES6 | |
String.prototype.template = function (fn, object) {'use strict'; | |
// Andrea Giammarchi - WTFPL License | |
var | |
hasTransformer = typeof fn === 'function', | |
stringify = JSON.stringify, | |
re = /\$\{([\S\s]*?)\}/g, | |
strings = [], | |
values = hasTransformer ? [] : strings, |
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
# -*- coding: utf-8 -*- | |
''' | |
Create a catalog of articles | |
As a rule I finish the layout with some hand touches, but the bulk of it is generated. | |
For each article display name, description, photo. | |
Layout articles in two columns on the page. | |
Articles are grouped by category and each category begins on a new page. | |
Find a finished example at http://monomon.me/stuff/mmcosmetics/mm_catalog.pdf |
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/sh | |
timeout=6 | |
#card=3,0 | |
# query card number from aplay | |
card=`aplay -l | sed -n '/Komplete/s/card\ \([0-9]\).*device \([0-9]\).*/hw:\1,\2/p'` | |
if [ -z $card ] | |
then | |
echo "Komplete card not found" | |
exit |