Skip to content

Instantly share code, notes, and snippets.

View willfurnass's full-sized avatar

Will Furnass willfurnass

View GitHub Profile
@kuznero
kuznero / docker-clean.md
Last active April 1, 2023 12:28
Cleanup docker images and containers after failed builds

Cleanup docker images and containers after failed builds

Sometimes, there are some untagged images left behind after failed builds. In order to get rid of those, this script can be used.

#!/bin/bash
docker rm $(docker ps -aq)
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
@drj11
drj11 / codecafe.md
Last active March 10, 2016 15:26
R code cafe notes

no-one is using the etherpad.

by 1745 (15 minutes in) some people had made a plot, most people downloading and installing.

by 1800 (30 minutes in), many people have a plot.

installing on arch and gentoo is hard (arch user gave up installing Rstudio and used command line; gentoo user had to use VNC!). Installing on Ubuntu was hard too.

Someone asked "what does pch=1 do?" (in the call to legend)

@bnagy
bnagy / gpgmutt.md
Last active March 30, 2024 07:52
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
@takluyver
takluyver / README.md
Created September 6, 2014 21:44
Flatten notebooks for git diff

Copy nbflatten.py to somewhere on $PATH. Then, in the root of a git repository, run these commands:

echo "*.ipynb diff=ipynb" >> .gitattributes 
git config diff.ipynb.textconv nbflatten.py

When you change a notebook and run git diff, you'll see the diff of flattened, simplified notebooks, rather than the full JSON. This does lose some information (metadata, non-text output), but it makes it easier to see simple changes in the notebook.

This doesn't help with merging conflicting changes in notebooks. For that, see nbdiff.org.

@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@minrk
minrk / nbstripout
Last active June 6, 2023 06:23
git pre-commit hook for stripping output from IPython notebooks
#!/usr/bin/env python
"""strip outputs from an IPython Notebook
Opens a notebook, strips its output, and writes the outputless version to the original file.
Useful mainly as a git filter or pre-commit hook for users who don't want to track output in VCS.
This does mostly the same thing as the `Clear All Output` command in the notebook UI.
LICENSE: Public Domain
@ryangomba
ryangomba / optics.py
Last active March 15, 2024 15:33
OPTICS clustering in Python
# Copyright (c) 2012, Ryan Gomba
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation