Skip to content

Instantly share code, notes, and snippets.

#$ git branch --edit-description FOO
#$ git branches
#> FOO - 'some description'
#> Bar -
#> Bob -
[alias]
branches = !"for b in `git branch --list | tr -d '* '`; do echo $b " - " `git config branch.$b.description`; done"
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active April 24, 2024 18:56
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@igniteflow
igniteflow / env-context.py
Last active December 12, 2023 16:43
A Python context manager for setting/unsetting environment variables
from contextlib import contextmanager
"""
Usage:
with env_var('MY_VAR', 'foo'):
# is set here
# does not exist here
"""
@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
@kxtells
kxtells / cSpinner.py
Created July 20, 2012 20:35
Rotating Stick Class for Python
import sys
import threading
import time
class cSpinner(threading.Thread):
"""
Print things to one line dynamically
"""
chars = ["\\","|","/","-"]
index = 0
@jcollado
jcollado / conf.py
Created August 24, 2011 06:54
Mocking modules to prevent sphinx.ext.autodoc from failing on import
class Mock(object):
def __init__(self, *args):
pass
def __getattr__(self, name):
return Mock
for mod_name in ('pygtk', 'gtk', 'gobject', 'argparse'):
sys.modules[mod_name] = Mock()