Skip to content

Instantly share code, notes, and snippets.

@jterrace
jterrace / git-annex-gcs.sh
Last active September 8, 2021 22:09
An example of how to use Google Cloud Storage with git-annex
# Initialize git and git-annex
$ mkdir annex-gcs-test
$ cd annex-gcs-test/
$ git init
Initialized empty Git repository in /Users/jterrace/annex-gcs-test/.git/
$ git annex init "my machine"
init my machine ok
(Recording state in git...)
# Set up AWS credentials
@niksumeiko
niksumeiko / git.migrate
Last active July 19, 2024 21:32
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@lucemia
lucemia / gist:4a2e7a854caa7d6ec81f
Last active October 14, 2015 23:28
run mapreduce in bigquery
function mapper(row, emit) {
if(row.comment) {
keywords = row.comment.split(' ');
for(var i=0; i<keywords.length; i++) {
emit({keyword: keywords[i], count: 1});
}
}
}
function reducer(row, emit) {