Skip to content

Instantly share code, notes, and snippets.

View snbeynon's full-sized avatar
🐨
problem solver

sharon beynon snbeynon

🐨
problem solver
  • Amsterdam - Toronto - Brisbane
View GitHub Profile
Parameter placeholders denoted as `<`…`>`
Command | Explanation
------- | -----------
`git clone <repos-url> <dir>` | create `<dir>` if non-existent, and clone a git repos from `<repos-url>` there.
`git clone --depth <#> --branch <remote-branch> <repos-url> <dir>` | " … " clone only the last `<#>` commits of branch `<remote-branch>`. (a.k.a. *shallow copy*).
`git checkout -` | checkout previously checked out branch, i.e. similar to `cd -`
`git checkout -b <newBranch>` | create a new branch named `<newBranch>`, and switch to it.
`git checkout -b <newBranch> <trackingBranch>` | " … " and setup tracking branch.
`git branch -u <trackingBranch> (<branch>)` | set the (e.g. `upstream`) tracking branch of `<branch>` (or current branch, if none given), e.g. `git branch -u upstream/foo` OR `git branch -u upstream/foo localFoo`
#standardSQL
CREATE TEMPORARY FUNCTION
BASE64_TO_HEX(code BYTES)
RETURNS STRING
LANGUAGE js AS """
var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var equals = 0;
if (!code || code.length == 0) {
return null;
}