Skip to content

Instantly share code, notes, and snippets.

View ccarouge's full-sized avatar

Claire Carouge ccarouge

View GitHub Profile
@ccarouge
ccarouge / singleton.py
Created February 15, 2024 05:01
Create singleton object in python
"""Singleton Object."""
class Singleton(type):
"""Singleton base (meta) class."""
_instances = {}
def __call__(cls, *args, **kwargs):
"""Create the object on first call, return otherwise.
@ccarouge
ccarouge / example.sh
Created July 9, 2024 01:59
git svn a subset of branches
#!/bin/bash
svn_src_name=cable_src
# Copy all the branches we want to a single location in SVN
#svn copy --parents https://trac.nci.org.au/svn/cable/branches/Users/inh599/BLAZE_9184 https://trac.nci.org.au/svn/cable/branches/Share/ccc561/BLAZE_9184 -m "Copy for moving to git"
#svn copy --parents https://trac.nci.org.au/svn/cable/branches/Share/CABLE-POP_TRENDY https://trac.nci.org.au/svn/cable/branches/Share/ccc561/CABLE-POP_TRENDY -m "Copy for moving to git"
#svn copy --parents https://trac.nci.org.au/svn/cable/branches/Users/ms8355/CableHydraulics https://trac.nci.org.au/svn/cable/branches/Share/ccc561/CABLEHydraulics -m "Copy for moving to git"
#svn copy --parents https://trac.nci.org.au/svn/cable/branches/Users/ccc561/calendar_fix https://trac.nci.org.au/svn/cable/branches/Share/ccc561/calendar_fix -m "Copy for moving to git"
#svn copy --parents https://trac.nci.org.au/svn/cable/branches/Users/rk4417/DevBr-1 https://trac.nci.org.au/svn/cable/branches/Share/ccc561/DevBr-1 -m "Copy for moving to git"