Skip to content

Instantly share code, notes, and snippets.

View MarcCote's full-sized avatar

Marc-Alexandre Côté MarcCote

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:

@jaygooby
jaygooby / git_notes.md
Last active April 29, 2026 15:14
Git, you bloody git

Checkout a stash overwriting the current branch

git checkout stash@{0} -- .

This will potentially overwrite uncommitted files so you may lose work.

Via https://www.vincentschmalbach.com/applying-git-stash-changes-with-force/

Create a git alias to show all your git aliases

git config --global alias.alias "! git config --get-regexp ^alias. | sed -e s/^alias.// -e s/\ /\ =\ /"

@schlamar
schlamar / processify.py
Last active December 4, 2025 10:37
processify
import os
import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.
Be sure that every argument and the return value