Skip to content

Instantly share code, notes, and snippets.

Sean Hammond seanh

Block or report user

Report or block seanh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@seanh
seanh / dayfolder.py
Created Jan 25, 2020
Move the contents of ~/Desktop into today's day folder
View dayfolder.py
#!/usr/bin/env python3
"""Move the contents of ~/Desktop into ~/Notes/DAY_FOLDERS/YYYY/MM/DD/.
Create today's day folder (~/Notes/DAY_FOLDERS/YYYY/MM/DD/) and its parent
folders if they don't exist already, and then move everything from ~/Desktop
into today's day folder.
If ~/Desktop is already empty then don't do anything (don't create an empty day
folder).
@seanh
seanh / README.md
Last active Jan 1, 2020
Breadcrumbs for GitHub Pages / Jekyll. Pure Liquid (no Jekyll plugin). https://seanh.github.io/posts/2020/01/01/jekyll-breadcrumbs/
View README.md

Jekyll Breadcrumbs

This is a Jekyll template include that renders navigation breadcrumbs for a page or post. The breadcrumbs include the page or post's collection, categories, date and title. They look something like this:

Home > Posts > 2019 > Dec > 23 > My Blog Post

Installation

View keybase.md

Keybase proof

I hereby claim:

  • I am seanh on github.
  • I am seanh (https://keybase.io/seanh) on keybase.
  • I have a public key ASCq-eMWC05hYtOsEKmHi34n_lDmcEvvHBR_uN1U2AtOqwo

To claim this, I am signing this object:

@seanh
seanh / netrw.md
Last active Jan 4, 2020
Netrw Cheatsheet (Vim's Built-in Directory Browser)
View netrw.md

Netrw Cheatsheet (Vim's File Browser)

See also:

  • vinegar.vim, which makes - open netrw in the directory of the current file, with the cursor on the current file (and pressing - again goes up a directory). Vinegar also hides a bunch of junk that's normally at the top of netrw windows, changes the default order of files, and hides files that match wildignore.

    With vinegar, . in netrw opens Vim's command line with the path to the file under the cursor at the end of the command. ! does the same but also prepends ! at the start of the command. y. copies the absolute path of the file under the cursor. ~ goes to your home dir. Ctrl+6 goes back to the file (buffer) that you had open before you opened netrw.

To launch netrw:

@seanh
seanh / vimgrep.md
Last active Jan 4, 2020
vimgrep cheatsheet
View vimgrep.md

vimgrep

  • Vimcasts on vimgrep

  • Uses native vim regexes (which are slightly different from the regexes used by grep, ack, ag, etc) so the patterns are the same as with vim's within-file search patterns.

    You can do a normal within-file search first, then re-use the same pattern to

@seanh
seanh / obsession.vim.md
Last active Jun 12, 2019
obsession.vim cheatsheet (simple, no-hassle Vim sessions from Tim Pope)
View obsession.vim.md

obsession.vim cheatsheet

obsession.vim is simple, no-hassle Vim sessions from Tim Pope. It's a small plugin that just provides :Obsession, a better replacement for the standard :mksession command.

  • Adds the :Obsession command:

    • :Obsession with no argument creates a Session.vim file in the current
View !unicode_in_python.markdown

Unicode in Python 2 and 3

My notes on unicode handling in Python 2 and 3, with runnable tests.

So far this is very heavily based on Ned Batchelder's Pragmatic Unicode, it's basically my notes on that presentation, with the examples from that presentation in the form of runnable tests. I may add more to these notes in time though.

@seanh
seanh / !mocha.md
Last active Jan 4, 2020
My notes on the Mocha JavaScript test framework
View !mocha.md

Mocha

Installation

To run this gist install git, node and npm and then:

$ git clone https://gist.github.com/19e682776b2716283983abda78e6f8aa.git
@seanh
seanh / user_stories.md
Last active Jan 4, 2020
My notes on user stories
View user_stories.md

User Stories

Reading list

  • [Mark Shead: Creating Good User Stories][Mark Shead]
  • [GOV.UK Service manual: Writing user stories][GOV.UK]
  • [Mike Cohn's blog posts about user stories][Mike Cohn]
  • [Mike Cohn: User Stories Applied (book)][User Stories Applied]
@seanh
seanh / raw_html_elements_on_github.md
Last active Jan 23, 2018
Raw HTML Elements You Can Use on Github
View raw_html_elements_on_github.md

Raw HTML Elements You Can Use on Github

GitHub Gist (and anywhere else where HTML is rendered on GitHub) allows you to use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM synactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

  • Sample or quoted outpu

You can’t perform that action at this time.