Skip to content

Instantly share code, notes, and snippets.

View willcharlton's full-sized avatar

Will Charlton willcharlton

  • Minneapolis, MN
View GitHub Profile
@Saissaken
Saissaken / Update git fork with tags.sh
Last active April 20, 2024 18:10
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@simonw
simonw / how-to.md
Last active March 26, 2024 23:21
How to create a tarball of a git repository using "git archive"
@lumengxi
lumengxi / Makefile
Created March 17, 2016 16:44
Makefile for Python projects
.PHONY: clean-pyc clean-build docs clean
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
@vsudilov
vsudilov / gist:cc25a6eee101a375bfed
Created June 5, 2015 18:15
in-memory tarfile with in-memory contents
tar_fileobj = io.BytesIO()
with tarfile.open(fileobj=tar_fileobj, mode="w|") as tar:
my_content = "abdef".encode('utf-8')
tf = tarfile.TarInfo("my_file_name")
tf.size = len(my_content)
tar.addfile(tf, io.BytesIO(my_content))
tar_fileobj.seek(0)
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive