Skip to content

Instantly share code, notes, and snippets.

View fnurl's full-sized avatar

Jody Foo fnurl

  • Linköping University
  • Linköping, Sweden
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fnurl on github.
  • I am fnurl (https://keybase.io/fnurl) on keybase.
  • I have a public key whose fingerprint is 896D FC0D 2784 C8E5 0811 8EC2 9F9A AE80 1483 96CB

To claim this, I am signing this object:

@fnurl
fnurl / bolarized_light.taskpapertheme
Created August 10, 2012 14:31
A taskpaper theme that is inspired by Byword, Solarized and iA Writer
<theme>
<!-- Extra colors -->
<color id="caret_blue" red="0" green="0.741" blue="1.0" alpha="1.0"/>
<color id="bg" red="0.988" green="0.988" blue="0.988" alpha="1.0"/>
<color id="fg" red="0.235" green="0.235" blue="0.235" alpha="1.0"/>
<color id="gray" red="0.5" green="0.5" blue="0.5" alpha="1.0"/>
<color id="light_blue" red="0.710" green="0.835" blue="1.0" alpha="1.0"/>
<!--Solarize color pallette, see http://ethanschoonover.com/solarized-->
<color id="blue" red="0.149" green="0.545" blue="0.824" alpha="1.0"/>
@fnurl
fnurl / search-replace.py
Created August 10, 2012 17:54
Read file with tab separated search and replace entries (one per line) and apply them to a target file and output to std-out.
#!/usr/bin/python
# -*- coding: utf_8 -*-
#
import sys
import re
import os
import codecs
targetfile = sys.argv[1]
@fnurl
fnurl / py-le3a-ht13.py
Last active December 31, 2015 13:49
Pythonlektion 3a HT2013
# Rövarspråk
#
# Skriv en funktion, rovarisera(text), som tar in en sträng och returnerar
# rövarspråksvarianten. För att göra vanligt språk till rövarspråk, lägger man
# ett "o" efter varje konsonant, följt av konsonanten igen. Strängen "hej" blir
# alltså, "hohejoj". Anta att strängen som kommer in till funktionen består
# enbart av gemener.
def rovarisera(text):
pass
@fnurl
fnurl / py-le3b-ht13.py
Last active December 31, 2015 13:49
Pythonlektion 3b HT2013
# Referensövning
def ref_test1():
a = [1, 2, 3]
b = a
a.append(4)
# Vad skriver nedanstående rader ut? Varför?
print(a)
@fnurl
fnurl / hooks.py
Last active January 13, 2017 21:55
A hook for alot that adds format="flowed" to the Content-type header
# This hook needs some changes to the alot code
#
# Currently, only commands initiated from the command line have hooks.
# However, in order to add this hook, we need all commands to have hooks,
# also those created by other commands.
#
# When replying to a message in a thread, the thread.reply command
# is triggered, but it in turn triggers compose which in turn triggers
# edit. These two last commands do not have any hooks attached to them.
#
@fnurl
fnurl / pygmentize-clipboard-highlighter.sh
Last active April 6, 2017 21:56
Highlight code in clipboard using pygmentize (Mac)
#!/bin/bash
pbpaste | pygmentize -O"style=tango, fontface=Menlo" -f rtf -l $1 | pbcopy
@fnurl
fnurl / keybindings.tmux
Created August 7, 2018 10:10
tmux config
# updated for tmux 2.4: use send-keys -X for copy mode
# Help
#
# Bindings belong to tables. The prefix table is used when the following
# commands are used:
#
# bind-key -T prefix <key> <command>
# bind-key <key> <command>
#
@fnurl
fnurl / docsearch-pageindexer.py
Last active January 15, 2020 07:07
A script that produces a JSON page index file for markdown files (extension `.md`) in a directory and its subdirectories (e.g. a Hugo site's (https://gohugo.io/) `content` directory) for use with Algolia Docsearch (https://github.com/algolia/docsearch).
import os
import sys
import yaml
import json
# base url to use
base_url = "http://localhost:1313"
# The attribute mapping for docsearch.
#
@fnurl
fnurl / .latexmkrc
Created July 15, 2012 18:14
my .latexmkrc that I use with MacTex
# Use xelatex instead of pdflatex
$pdflatex = 'xelatex -synctex=1 -interaction=nonstopmode --shell-escape %O %S';
# Always create PDFs
$pdf_mode = 1;
# Use Skim.app to preview generated PDFs
$pdf_previewer = 'open -a Skim.app %S';
# Use continous mode by default