Skip to content

Instantly share code, notes, and snippets.

@bradwilson
bradwilson / settings.json
Last active April 16, 2024 16:14
Ubuntu color scheme for Windows Terminal
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": "copy",
"keys": "ctrl+shift+c"
},
{
"command": "paste",
@mattseymour
mattseymour / build-instructions
Created May 1, 2017 06:58
Build Python 3.6 from source for Ubuntu and Debian
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 February 23, 2023 23:49
Maya base class for building custom shelves.
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 March 16, 2022 17:14
Nodes with unique IDs

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 November 3, 2014 17:36
How effectively delete a git submodule.

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 December 14, 2023 15:07
Get AMI ID from a packer build
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 February 14, 2014 08:32
Create new branch with empty folder structure
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: