Skip to content

Instantly share code, notes, and snippets.

View icoloma's full-sized avatar

Nacho Coloma icoloma

View GitHub Profile
@icoloma
icoloma / maps-csp-test.js
Last active December 31, 2015 04:29
Test for using Google Maps with Content-Security-Policy
var http = require('http')
// To use: execute "node maps-csp-test.js" and open a browser at localhost:8000
// remember to restart the server after making any changes
var server = http.createServer( function(request, response) {
response.writeHead(200, {
'Content-Type': 'text/html; charset=UTF-8'
// This makes Google Maps work
@icoloma
icoloma / keybase.md
Created March 28, 2014 07:14
keybase.md

Keybase proof

I hereby claim:

  • I am icoloma on github.
  • I am icoloma (https://keybase.io/icoloma) on keybase.
  • I have a public key whose fingerprint is 1273 BC17 C42F 96B1 616D A4E8 5164 B8EC 99C7 D0E7

To claim this, I am signing this object:

@icoloma
icoloma / backup
Last active August 7, 2025 11:29
Backup a Github repository into a local file. Useful when retiring a Github repository, but keeping a backup copy for a rainy day in Dropbox / Drive / Box.
#!/bin/bash
# Backup the repositories indicated in the command line
# Example:
# bin/backup user1/repo1 user1/repo2
set -e
for i in $@; do
FILENAME=$(echo $i | sed 's/\//-/g')
echo "== Backing up $i to $FILENAME.bak"
git clone git@github.com:$i $FILENAME.git --mirror
cd "$FILENAME.git"
@icoloma
icoloma / BigQuery.sh
Last active November 18, 2019 10:53
Google Cloud Recipe Book
# Get the list of jobs launched for a given project (the project ID is optional)
bq ls -j -n 10000 -a project_id > jobs.txt
bq ls -j -n 10000 -a marine-tractor-567789 > jobs.txt
# Get the details for a given job (the project ID is optional)
bq show --format=prettyjson -j project_id:job_id
bq show --format=prettyjson -j marine-tractor-567789:job_ftnDrpo8JqiJtajBH2AEZxJCLpw
More details: http://stackoverflow.com/questions/31150542/logging-all-bigquery-queries
@icoloma
icoloma / from-agenda-get-authors
Last active September 16, 2018 08:29
Snippets around the agenda for Commit Conf
// extract all author names
const authorNames = new Set();
agenda.days.forEach(
d => d.tracks.forEach(
t => t.slots.forEach(
s => {
if (s.contents && s.contents.authors) {
s.contents.authors.forEach(({name}) => authorNames.add(name))
}
}
@icoloma
icoloma / Check out branch directly
Last active March 13, 2017 19:41
Create a github-pages branch from scratch on an existing repo
git clone -b gh-pages <remote_repo> <folder-name>