Skip to content

Instantly share code, notes, and snippets.

@dmkash
dmkash / br.sh
Created April 10, 2012 22:44
Shell Script for tmux setup
#!/bin/sh
SESSION_NAME="big_red"
cd ~/Sites/within3/big_red
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then
@rectangletangle
rectangletangle / gist:0a0d5a2e84dd3178d348
Last active January 29, 2022 17:32
Python 3 Monkeypatch Context Manager
""" This is a convenient way to monkeypatch a method or attribute of a Python
object. This is great for situations where you want to modify a global
object within a limited scope, i.e., your typical class or module when
testing. This was tested and works with Python 2.7 and 3.4. """
import contextlib
@contextlib.contextmanager
def monkeypatched(object, name, patch):
""" Temporarily monkeypatches an object. """
@kenjyco
kenjyco / 01-Learning-Python3.md
Last active May 25, 2024 10:20
Learn Python 3 with Jupyter Notebook
@tachang
tachang / gist:2117833a395504bae0bde9979f4e201e
Created March 10, 2017 20:34
How to install NodeJS without root
wget https://nodejs.org/dist/v6.10.0/node-v6.10.0-linux-x64.tar.xz
tar xvfJ node-v6.10.0-linux-x64.tar.xz
echo 'export PATH=$HOME/node-v6.10.0-linux-x64/bin:$PATH' >> ~/.bashrc
. ~/.bashrc