Skip to content

Instantly share code, notes, and snippets.

@mattseymour
mattseymour / build-instructions
Created May 1, 2017
Build Python 3.6 from source for Ubuntu and Debian
View build-instructions
Prerequisties install:
- sudo apt-get install build-essential checkinstall
These are the dependancies required by python:
- sudo apt-get install libbz2-dev libc6-dev libgdbm-dev libncursesw5-dev libreadline-gplv2-dev libssl-dev libsqlite3-dev tk-dev
Download the tar source file from python.org (at the time of writing 3.6.1 is the latest release):
- wget -O ~/Downloads/python3.6.1.tgz https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
Via command line navigate to the downloaded file directory:
@vshotarov
vshotarov / shelfBase.py
Last active Oct 5, 2021
Maya base class for building custom shelves.
View shelfBase.py
import maya.cmds as mc
def _null(*args):
pass
class _shelf():
'''A simple class to build shelves in maya. Since the build method is empty,
it should be extended by the derived class to build the necessary shelf elements.
@mottosso
mottosso / README.md
Last active Mar 16, 2022
Nodes with unique IDs
View README.md

Nodes with unique IDs in Maya

unique_id1.py associates a new ID to every DAG-node in the scene, unique_id2.py does the same but keeps existing IDs as-is. Finally, unique_id3.py updates IDs and ensures that no duplicate ID exists in the scene.

@myusuf3
myusuf3 / delete_git_submodule.md
Created Nov 3, 2014
How effectively delete a git submodule.
View delete_git_submodule.md

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@danrigsby
danrigsby / packer-ami-id
Last active Aug 30, 2022
Get AMI ID from a packer build
View packer-ami-id
packer build packer.json 2>&1 | sudo tee output.txt
tail -2 output.txt | head -2 | awk 'match($0, /ami-.*/) { print substr($0, RSTART, RLENGTH) }' > sudo ami.txt
@j8
j8 / git_empty_branch
Created Feb 14, 2014
Create new branch with empty folder structure
View git_empty_branch
You can create a new empty branch like this:
$ git checkout --orphan NEWBRANCH
--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
The --orphan command keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch.
Since you want to create a new empty branch that has nothing to do with the original branch, you can delete all files in the new working directory: