Skip to content

Instantly share code, notes, and snippets.

Toni Cebrián tonicebrian

View GitHub Profile
@tonicebrian
tonicebrian / orphan-branches.sh
Created Jan 21, 2020
Find who created the last commit in unattended remote branches
View orphan-branches.sh
#!/bin/bash
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci\t%cr\t%cN" $branch | head -n 1` \\t$branch; done | sort -r
@tonicebrian
tonicebrian / gist:fcdf1228e31735c12c6ffc9c978a522f
Created Sep 17, 2019
Check for variables defined in bash script
View gist:fcdf1228e31735c12c6ffc9c978a522f
for var in MY_ENV_VAR_1 MY_ENV_VAR_2; do
if [[ -z "${!var:-}" ]];
then
echo "You need to provide a value for env variable $var"
exit 1
fi
done
View neo4j-btc-cypher
CREATE INDEX ON :Block(height);
CREATE INDEX ON :Transaction(hash);
CREATE INDEX ON :Output(tx_hash, output_index);
CREATE INDEX ON :Address(address_string);
LOAD CSV WITH HEADERS FROM "http://storage.googleapis.com/bitcoin-neo4j-etl/blocks.csv" AS row
MERGE (b:Block {height: toInt(row.number)})
ON CREATE SET
b.hash = row.hash,
b.size = toInt(row.size),
View keybase.md

Keybase proof

I hereby claim:

  • I am tonicebrian on github.
  • I am tonicebrian (https://keybase.io/tonicebrian) on keybase.
  • I have a public key ASCRxHtGVkzN4Jafqr5R2uv0u5SniW01xVznq_VF-kidkgo

To claim this, I am signing this object:

@tonicebrian
tonicebrian / GBT_CaliforniaHousing.py
Created Nov 5, 2012
Gradient Boosting Trees using Python
View GBT_CaliforniaHousing.py
# =============
# Introduction
# =============
# I've been doing some data mining lately and specially looking into `Gradient
# Boosting Trees <http://en.wikipedia.org/wiki/Gradient_boosting>`_ since it is
# claimed that this is one of the techniques with best performance out of the
# box. In order to have a better understanding of the technique I've reproduced
# the example of section *10.14.1 California Housing* in the book `The Elements of Statistical Learning <http://www-stat.stanford.edu/~tibs/ElemStatLearn/>`_.
# Each point of this dataset represents the house value of a property with some
# attributes of that house. You can get the data and the description of those
@tonicebrian
tonicebrian / tunnel.py
Created Dec 15, 2015
Paramiko tunnel
View tunnel.py
# Create a SSH connection
import paramiko
import os
ssh = paramiko.SSHClient()
ssh._policy = paramiko.WarningPolicy()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_config = paramiko.SSHConfig()
user_config_file = os.path.expanduser("~/.ssh/config")
You can’t perform that action at this time.