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
| Date | Amount | Description | | |
|------------+------------------------+-------------------| | |
| 2011-11-15 | 100.00 | Big client dinner | | |
| 2011-11-18 | 15.00 | Screen cleaner | | |
| 2011-11-21 | 110 | London ticket | | |
|------------+------------------------+-------------------| | |
| | VSUM([100., 15., 110]) | | | |
#+TBLFM: @5$2=VSUM(@I..@II) |
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
# An example of using a pipemill just to split words | |
args="~/somedir ssh://host/remote" | |
echo $args | while read local remote | |
do | |
something $local $remote | |
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
# If you only need a few users this is ideal, alter the nferrier part to be regex or: | |
# | |
# (nferrier|jsmith|dharry) | |
# | |
# If you need any user then use ([A-Za-z0-9-]+) in the regex and use an if to check: | |
# | |
# if (! -d /home/$1/public_html) { | |
# return 403; | |
# } | |
# |
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
;; test | |
(setq lexical-binding t) | |
(defun nic-test-1 (alist-symbol) | |
(symbol-value 'alist-symbol)) | |
(let ((x 10)) | |
(nic-test-1 x)) |
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
(setq lexical-binding t) | |
(defun nic-test-1 (x) | |
(message "base nic test %s" x)) | |
(let ((old-nic-test-1 (symbol-function 'nic-test-1)) | |
(z 10)) | |
(flet ((nic-test-1 | |
(y) | |
(funcall old-nic-test-1 y) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:str="http://exslt.org/strings" | |
xmlns:re="http://exslt.org/regular-expressions" | |
extension-element-prefixes="str regexp" | |
xmlns="http://www.w3.org/1999/xhtml"> | |
<xsl:output mode="text" omit-xml-declaration="yes"/> | |
<xsl:template match="/"> | |
<xsl:apply-templates select="//table//tr" mode="variables"> |
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 | |
# Force a vagrant config to use my private key pair | |
case $1 in | |
help|-h|--help) | |
cat <<EOF | |
vagrant-privatekey [Vagrantfile] [private key file] | |
changes the Vagrantfile (or ./Vagrantfile) to use the private-key-file (or |
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
(defun nic-child-lisp-hook (child-lisp) | |
;; version of a hook function which wraps child-lisp | |
`((flet ((my-func (x) (message "hello!"))) | |
,@child-lisp))) | |
(defun nic-child-lisp-hook (child-lisp) | |
;; version of a hook function which just returns child-lisp for | |
;; interpolation | |
child-lisp) |
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
(defmacro elnode--mock-process (process-bindings &rest body) | |
"Allow easier elnode testing by mocking the process functions. | |
For example: | |
(elnode--mock-process (:elnode-http-params | |
(:elnode-http-method \"GET\") | |
(:elnode-http-query \"a=10\")) | |
(should (equal 10 (elnode-http-param 't \"a\"))) | |
) |
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
(ert-deftest elnode--http-parse-body-incomplete () | |
"Tests the HTTP parsing of an incomplete body. | |
An HTTP request with an incomplete body is setup and tested, then | |
we finish the request (fill out the content to content-length) | |
and then test again." | |
(elnode--mock-process | |
((:buffer | |
(elnode--http-make-hdr | |
'get "/" |