Skip to content

Instantly share code, notes, and snippets.

View mnot's full-sized avatar

Mark Nottingham mnot

View GitHub Profile
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@joyrexus
joyrexus / README.md
Last active February 19, 2024 17:15 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@Sam0230
Sam0230 / utm-arch-linux-installation-guide.md
Last active February 15, 2024 21:01
Installing Arch Linux ARM in a UTM virtual machine

Installing Arch Linux ARM in a UTM virtual machine

Steps:

  1. Create a new virtual machine.
  2. Go to System tab, change architecture to `ARM64 (aarch64)' and increase memory as needed.
  3. Download Alpine Linux LiveCD:
mirror=https://dl-cdn.alpinelinux.org/alpine
curl -o alpine-virt-latest-aarch64.iso "$mirror/latest-stable/releases/aarch64/$(curl "$mirror/latest-stable/releases/aarch64/latest-releases.yaml" | /usr/bin/grep -E 'file: alpine-virt-[0-9\.]+-aarch64\.iso' | head -n 1 | sed 's/ //g' | sed 's/\t//g' | sed 's/^file://')"
  1. Go to Drives tab, New Drive, set size to 20GiB or larger, then Inport Drive, choose the file you just downloaded.
@jamescasbon
jamescasbon / template.py
Created December 11, 2011 16:37
Pure python templates using with statement
"""
A really stupid python template language inspired by coffeekup, markaby.
Do not use this code, it will ruin your day. A byproduct of insomnia.
TL;DR
-----
This module defines a template language that allows us to do:
d = Doc()
@annevk
annevk / formatting.md
Last active April 15, 2016 08:45
Formatting conventions for standards

Use a column width of 100 characters.

Do not use newlines inside "inline" elements, even if that means exceeding the column width requirement.

<p>The
<dfn method for=DOMTokenList lt=remove(tokens)|remove()><code>remove(<var>tokens</var>&hellip;)</code></dfn>
method, when invoked, must run these steps:

is okay and