Skip to content

Instantly share code, notes, and snippets.

@bloom
bloom / macjournal_import.rb
Created May 18, 2011 00:27
Import to Day One Journal app from MacJournal Export
require "open3"
def readfile(file)
f = File.open(file)
lines = f.readlines("\n\n\n\n")
lines.each do |line|
fields = line.scan(/\s+Date:\s([^\n]+)$\s+Topic:\s([^\n]+)\n(.*)/m)
date = fields[0][0].strip
@bosmacs
bosmacs / latex.template
Created June 28, 2011 19:39 — forked from michaelt/latex.template
Simple Pandoc latex.template with comments
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
@craigeley
craigeley / multimarkdown-chicago-fullnote
Created February 10, 2012 04:57
A modification of the Zotero Chicago Style for use with MultiMarkdown (Plain text) writing
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="sort-only">
<info>
<title>Multimarkdown - Chicago (full note)</title>
<id>http://fieldnoise.com/styles/markdown-chicago-fullnote</id>
<link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/>
<author>
<name>Julian Onions</name>
<email>[email protected]</email>
</author>
@ianthekirkland
ianthekirkland / Finder-ApplyColorLabelToSelectedItems.applescript
Created April 17, 2012 07:45
Apply color labels to selected Finder items; Ideal for assigning to hotkeys via a Launcher app such as "Keyboard Maestro", "Butler", or "Alfred".
-- Finder-ApplyColorLabelToSelectedItems
-- ©2011 Ian Kirkland, M.Ed, Kirkland Professional Studios
(*
I like to use Finder labels in conjunction with smart folders that point to files and/or folders of a specific label color. That way, I can use red labels for "urgent" to-do items, orange labels for "standard to-do", etc. This script allows a much quicker way of applying color labels.
LEGEND
-------------------------------------------------
Keystroke | Appearance | Label Index
-------------------------------------------------
key "0" = No color = 0
# Very (very) naive wordt segmentation algorithm for Chinese
# (or any language with similar characteristics, works at the
# character level.)
class Partitioner
attr_reader :ngrams
# +ngrams+ Enumerable list of ngrams
def initialize(ngrams, lookahead = 6)
@lookahead = lookahead
@ngrams = {}
@lmullen
lmullen / ToggleFootnoteJumping.vim
Created April 3, 2013 13:47
Jump between footnote markers with Vim's * key
" Find related Pandoc footnote numbers
" -------------------------------------------------------------------
" Vim's * key searches for the next instance of the word under the
" cursor; Vim decides what counts as the boundary of a word with the
" iskeyword option. This function toggles the special characters of a
" Pandoc footnote in the form [^1] to allow you to jump between
" footnotes with the * key.
nnoremap _fn :call ToggleFootnoteJumping()<CR>
function! ToggleFootnoteJumping()
if exists("g:FootnoteJumping")
@wcaleb
wcaleb / iMDtoPDF.py
Last active July 8, 2024 08:17
iMDtoPDF
#! /usr/bin/env python
# -*- coding: utf-8 -*-
## iMDtoPDF.py
## by W. Caleb McDaniel
## http://wcm1.web.rice.edu
## This is a wrapper script for sending documents to Docverter
## for conversion from markdown to PDF using Pandoc. Typically
## Docverter calls are made with cURL; this script uses httplib.
This file has been truncated, but you can view the full file.
{"昱" {"21503.090" ["yù"]}, "羉" {"42930.080" ["luán"]}, "覸" {"63675.020" ["jiān"]}, "洗" {"31608.080" ["xiǎn" "xǐ"]}, "㸺" {"31812.010" ["shā"]}, "零" {"64061.010" ["líng" "lián"]}, "蹁" {"63726.060" ["pián"]}, "嫢" {"21075.030" ["guī" "zuī"]}, "㵯" {"31771.050" ["féng"]}, "𠏕" {"10224.010" ["xiào"]}, "𠞶" {"10354.120" ["zhāi"]}, "𢋝" {"20906.120" ["kǎi"]}, "𣉡" {"21522.180" ["tǐng"]}, "𣨣" {"21390.060" ["jiàng"]}, "𣸄" {"31683.050" ["zǎn"]}, "𤶈" {"42670.110" ["xī"]}, "𦓎" {"42811.010" ["nài"]}, "𦢯" {"32124.100" ["xìn" "xìng"]}, "𧑒" {"42893.120" ["tūn"]}, "鞠" {"74340.010" ["jū" "qū" "qiōng"]}, "秞" {"42599.040" ["yóu"]}, "堋" {"10455.090" ["péng" "bèng" "pēng" "pīng"]}, "租" {"42599.020" ["zū" "jū"]}, "邡" {"63760.010" ["fāng" "fàng"]}, "閕" {"74288.020" ["xiā" "xiǎ"]}, "魮" {"74677.020" ["pí" "bǐ"]}, "㽨" {"42551.060" ["cuó"]}, "蝻" {"42868.070" ["nǎn"]}, "倖" {"10170.060" ["xìng"]}, "圐" {"10722.130" ["kū"]}, "焐" {"32203.120" ["wù"]}, "睷" {"42500.020" ["jiān"]}, "𠡮" {"10373.100" ["bēng" "kēng"]}, "覰" {"63674.050" ["qù"]}, "髇" {"74