Skip to content

Instantly share code, notes, and snippets.

@aclarknexient
aclarknexient / .iterm-colours.zsh
Last active March 19, 2024 03:51
Set iTerm2 tab colours based on the command you are running
# A dotfile to turn iTerm2 tabs a different colour based on the command glob.
# Useful for marking different environments in different colours.
# Cargo-culted from multiple sources, apologies for not fully acknowledging them :(
# Edit the line that reads "if [[ "$1" =~ "^(login-helper) " ]]; then" and replace
# "login-helper" with whatever command you use to authenticate. Then modify the case
# statement to match your auth command's arguments. For example: you may use a script
# called "authsaml" to authenticate, and its arguments are dev, test, preprd, and prd.
# Change the colour function you call if you want to change tab colours.
@M0r13n
M0r13n / render.html
Last active October 6, 2023 06:32
A sample Wtforms field for creating a list of tags with custom separators, e.g. "," or " ".
<form action="" method="POST" role="form" class="form">
{{ form.hidden_tag() }}
<!--Other fields-->
{{ wtf.form_field(form.tags, placeholder='audio, hardware, chip') }}
<button class="btn btn-success" type="submit">submit</button>
</form>
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active June 16, 2024 02:34
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@0chroma
0chroma / VFIO Setup Guide.md
Last active March 12, 2024 13:49
Windows 10 VFIO QEMU Setup

VFIO Setup Guide

I play games regularly, and the sad reality is that it forces me to use Windows on my desktop. There's a Linux installation on there, but rebooting into it is such a massive interruption that I usually just move over to my laptop for programming. Working on a laptop leads to all sorts of ergonomic issues, and it felt like a massive waste to not develop on the desktop hardware I invested so much in. So after extensively researching what the VFIO community has been doing, I've deleted my Windows installation and moved all my gaming into a virtual machine on a Linux host.

Normally VMs are too slow for gaming, but thanks to a feature called VFIO you can run games at near-native performance by passing graphics cards and USB controllers directly to a virtual machine. The only requirement is that your board supports IOMMU, which most modern systems have. In this guide I'll wal

@SpainTrain
SpainTrain / config_model.py
Created June 12, 2017 17:19
Store Config for Google App Engine Python App in Datastore (https://12factor.net/config)
from os import environ
from google.appengine.ext import ndb
from google.appengine.ext.ndb import model
from pydash import snake_case
class Config(ndb.Model):
value = ndb.StringProperty()
value_previous = ndb.StringProperty()
@manasthakur
manasthakur / plugins.md
Last active June 2, 2024 07:29
Managing plugins in Vim

Managing plugins in Vim: The basics

Let's say the plugin is at a GitHub URL https://github.com/manasthakur/foo. First get the plugin by either cloning it (git clone https://github.com/manasthakur.foo.git) or simply downloading it as a zip (from its GitHub page).

Adding a plugin in Vim is equivalent to adding the plugin's code properly into its runtimepath (includes the $HOME/.vim directory by default). For example, if the layout of a plugin foo is as follows:

foo/autoload/foo.vim
foo/plugin/foo.vim
@mdo
mdo / 00-intro.md
Last active March 24, 2024 08:04
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@PurpleBooth
PurpleBooth / README-Template.md
Last active June 16, 2024 07:49
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jxson
jxson / README.md
Created February 10, 2012 00:18
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation