Skip to content

Instantly share code, notes, and snippets.

View joao-aguizo's full-sized avatar

João Aguizo joao-aguizo

View GitHub Profile
@joao-aguizo
joao-aguizo / runableYaml.yaml
Created March 2, 2022 20:23
Shebang to make yaml executable (self-parsing in this case)
#!/bin/sh
python -c 'import yaml; import sys; print yaml.dump(yaml.load(sys.stdin), default_flow_style=False)'<<EOF
%YAML 1.1
---
receipt: Oz-Ware Purchase Invoice
date: 2007-08-06
customer:
given: Dorothy
family: Gale
@joao-aguizo
joao-aguizo / install.md
Created February 22, 2022 11:23 — forked from ZoomQuiet/install.md
Install SIP and PyQT4 (pyenv, pyenv-virtualenv)

Download

pyenv virtualenv

Switch to the Python version you want to use:

@joao-aguizo
joao-aguizo / Git Subtree basics.md
Created January 20, 2022 12:38 — forked from SKempin/Git Subtree basics.md
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this: