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
@fnurl
fnurl / 55-bytes-of-css.md
Created October 13, 2022 15:16 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@fnurl
fnurl / README.md
Created September 16, 2020 10:58 — forked from csswizardry/README.md
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
@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 / 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 / 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.
#

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 / 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 / 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 / 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 / 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]