Skip to content

Instantly share code, notes, and snippets.

@trauber
trauber / readme.md
Created September 13, 2014 02:52
Shell Script for Finding/Copying Shotwell Photos by Tag

forthcoming

@trauber
trauber / readme.md
Last active August 29, 2015 14:06
Comments on the GKOS Smartphone Keyboard (WP)

The gkos keyboard is good for writing short phrases. You write one and then copy and paste it into your document, which is in another program. I imagine you would then clear the gkos buffer and start a new or connected thought.

There are two layouts, alphabetic and optimized. I'm giving the optimized one a try; since it's based on key combination frequencies it should be more ergonomic. I'll probably give the alpha a try as well.

So far I haven't built up much speed, but I've only been using it for one day. My progress in this time convinces me speed will come with practice.

@trauber
trauber / -
Last active August 29, 2015 14:07
\raggedbottom in LaTeX Preamble fixes random vertical spacing at end of sections.
@trauber
trauber / readme.md
Created September 12, 2015 18:13
Parameterizing Powershell Variables
[CmdletBinding()]
param (
  [string] $Name,
  [int] $Age
)

Write-Host -Object "Hi $Name!","You are $Age years old!";
@trauber
trauber / comb
Created May 22, 2011 17:33
Create static html with mustache and favorite markup
#! /bin/bash
# Use mustache and your favorite markup to create static html.
# Use a markup that does standard read/write or change script.
FILE=$1
MARKUP=/usr/local/bin/markdown
echo "{{content}}" > mustache.tmp
mustache $FILE mustache.tmp | $MARKUP > content.tmp
sed -n '1,/^content: *|/ p' $FILE > yml.tmp
cat content.tmp | awk '{ print " " $0 }' >> yml.tmp
echo "---" >> yml.tmp
@trauber
trauber / readme.md
Last active October 12, 2015 03:12
grep-like posh Select-String Pipe

As close to grep as I have found so far:

<some-cmd> | Out-String -Stream | Select-String [options] <some-string>

Select-String's -Context option works pretty well ... so far.

@trauber
trauber / paragraphs.md
Last active December 13, 2015 19:38
Paragraphs

Their importance will increase as the volume of non-paged literature increases. Style guides recommend using the paragraph in citations when possible. I'd like to collect links to software that provides paragraph counts for web documents and for e-reader documents. I'd also like to write some tools.

So far the only online documentation I can find about navigating within ebook documents is on Kindle's "locations." From what I read they amount to 128 bytes of data. It doesn't matter whether these bytes display on the page. So these are very arbitrary chunks, and their logical is not readily discernible or readable the way a section's, subsection's or paragraph's is.

I did find a bookmarklet for counting DOM elements and modified to provide paragraph counts (gist) . It is also possible to provide paragraph numbering with CSS (cribbed from [stackoverflow article](http://stackoverflow.com/questions/6244591/css-styled-paragraphs-with-paragraph-numbering-and-sideno

javascript:styles='body%20{%20/*%20this%20is%20the%20element%20that%20will%20reset%20the%20numbers%20*/%20counter-reset:%20paragraphs%200;%20/*%20identifier%20&%20starting%20number%20*/%20}%20p:before%20{/*%20the%20element%20to%20receive%20the%20numbering%20*/%20counter-increment:%20paragraphs%201;%20/*%20identifier%20and%20increment%20value%20*/%20content:%20counter(paragraphs,%20decimal)%20".%20";%20/*%20identifier,%20number%20type,%20and%20what%20follows%20the%20numbering%20*/%20}';%20newSS%20=%20document.createElement('link');%20newSS.rel%20=%20'stylesheet';%20newSS.href%20=%20'data:text/css,'%20+%20escape(styles);%20document.documentElement.childNodes[0].appendChild(newSS);%20void%200
@trauber
trauber / README.md
Last active December 14, 2015 23:08
CSS Paragraph Numbering

CSS Paragraph Numbering

A demo of paragraph number with CSS's counter-increment. The demo also includes CSS for handling HTML5 asides.

@trauber
trauber / 2013-10-21-ledger-expenses.md
Created October 22, 2013 01:23
A Start at Doing Expenses with ledger
ledger -f ledger.ldg bal ^expenses show "" | less

Groups expenses according to string:string:.... syntax .