Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #!/bin/bash | |
| function git_submodule_unchanged () { | |
| SUB_MODULE=$1 | |
| GSC_RC=0 | |
| pushd $SUB_MODULE > /dev/null | |
| SUB_BRANCH=$(git branch | grep '*' | cut -d' ' -f 2) | |
| if [[ "$(git log --pretty=oneline origin/${SUB_BRANCH}..${SUB_BRANCH})" != "" ]]; then | |
| GSC_RC=1 | |
| fi |
| in upload handler | |
| in file close | |
| .. | |
| ---------------------------------------------------------------------- | |
| Ran 2 tests in 0.021s | |
| OK |
| #!/usr/bin/python | |
| import time | |
| from SimpleCV import Color, Image, np, Camera | |
| cam = Camera() #initialize the camera | |
| quality = 400 | |
| minMatch = 0.3 | |
| try: | |
| password = Image("password.jpg") |
| cy.visit('/404') | |
| //=> Test fails | |
| cy.visit('/404', {failOnStatusCode: false}) | |
| //=> Test passes but does not test the HTTP code was 404 | |
| cy.request({url: '/404', failOnStatusCode: false}).its('status').should('equal', 404) | |
| cy.visit('/404', {failOnStatusCode: false}) | |
| //=> Test passes, tests that the HTTP code was 404, and tests page was visited |
| build-container: | |
| stage: build | |
| image: | |
| name: moby/buildkit:rootless | |
| entrypoint: [ "sh", "-c" ] | |
| variables: | |
| BUILDKITD_FLAGS: --oci-worker-no-process-sandbox | |
| before_script: | |
| - | | |
| mkdir ~/.docker |
| #!/bin/bash | |
| BITS=2048 | |
| # In one line: | |
| # rm -f temp.key && ssh-keygen -t rsa -b 2048 -f temp.key -N "" -q && ssh-keygen -e -f temp.key -m PKCS8 | tr "\n" " " && echo && cat temp.key | tr "\n" " " && echo | |
| # In multiple lines: | |
| rm -f temp.key | |
| ssh-keygen -t rsa -b $BITS -f temp.key -N "" -q |
| # use ImageMagick convert | |
| # the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf | |
| convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
You can use this diagram as a template to create your own git branching diagrams. Here's how:
https://gist.githubusercontent.com/bryanbraun/8c93e154a93a08794291df1fcdce6918/raw/bf563eb36c3623bb9e7e1faae349c5da802f9fed/template-data.xml