Skip to content

Instantly share code, notes, and snippets.

View gglanzani's full-sized avatar

Giovanni Lanzani gglanzani

View GitHub Profile
@gglanzani
gglanzani / Heversine.ipynb
Created February 28, 2014 14:18
Haversine performance
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gglanzani
gglanzani / macvim
Last active August 29, 2015 13:59
brew install -v macvim 2>&1
~/C/scala-training ⮀ brew doctor
Your system is ready to brew.
~/C/scala-training ⮀ br
Updated Homebrew from 87500fdb to 120b1658.
==> New Formulae
sysdig
==> Updated Formulae
clens freerdp libdvdcss phantomjs
cloudfoundry-cli gforth midnight-commander sshguard
~/C/scala-training ⮀ brew --config

Keybase proof

I hereby claim:

  • I am gglanzani on github.
  • I am lanzani (https://keybase.io/lanzani) on keybase.
  • I have a public key whose fingerprint is D495 85D1 CBD3 BD0B BB17 C8B6 C2AA C094 1858 6A16

To claim this, I am signing this object:

from riak import RiakClient
from riak import RiakMapReduce
riak = RiakClient(protocol='pbc', host='172.17.12.22', http_port=8087)
bucket = riak.bucket("STATS")
mr = RiakMapReduce(riak)
keys = [d['_yz_rk'] for d in bucket.search(query="industry_id:[1 TO 22]", index="grid_stats", rows=1000)['docs']]
mr.add("STATS", keys[:40])
len(set(map(lambda x: x[:-5], keys[:40]))) # number of unique keys, 31 in this case
@gglanzani
gglanzani / erlang-shell
Created January 13, 2015 11:16
riak-python-client#396
riakc_pb_socket:mapred( Client, [
{<<"SCF">>,<<"satellite_00BCD806247A70C80E9780BBC274C42CB06F3047E03CABC0652F72FB0A2C55A0_False_2013-1">>},
{<<"SCF">>,<<"satellite_00BCD806247A70C80E9780BBC274C42CB06F3047E03CABC0652F72FB0A2C55A0_False_2013-3">>},
{<<"SCF">>,<<"satellite_00BCD806247A70C80E9780BBC274C42CB06F3047E03CABC0652F72FB0A2C55A0_False_2013-4">>},
{<<"SCF">>,<<"satellite_00BCD806247A70C80E9780BBC274C42CB06F3047E03CABC0652F72FB0A2C55A0_False_2013-5">>},
{<<"SCF">>,<<"satellite_00BCD806247A70C80E9780BBC274C42CB06F3047E03CABC0652F72FB0A2C55A0_False_2013-6">>},
{<<"SCF">>,<<"satellite_00BCD806247A70C80E9780BBC274C42CB06F3047E03CABC0652F72FB0A2C55A0_False_2013-7">>},
{<<"SCF">>,<<"satellite_00BCD806247A70C80E9780BBC274C42CB06F3047E03CABC0652F72FB0A2C55A0_False_2013-8">>},
#!/usr/bin/ruby
%w[fileutils ftools set zlib].each do |filename|
require filename
end
# Load the Marshal dump to a hash
def load file_name
begin
file = Zlib::GzipReader.open(file_name)
@gglanzani
gglanzani / backup.sh
Created August 5, 2011 10:51
My rsync script to backup my data
#!/bin/bash
# backup-script for rsync/osx
#
#
#
# ----- Set Default Parameters -----
#
# folders to backup..
@gglanzani
gglanzani / Output.log
Created November 25, 2011 16:12
brew install cclive
==> Downloading http://cclive.googlecode.com/files/cclive-0.6.5.tar.bz2
File already downloaded in /Users/gio/Library/Caches/Homebrew
==> ./configure --disable-debug --prefix=/usr/local/Cellar/cclive/0.6.5
==> make install
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/cclive.rb#L13
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: ed55d2f4bb8135b1330107410b807656e8df2285
HOMEBREW_PREFIX: /usr/local
@gglanzani
gglanzani / brettquix.txt
Created July 18, 2012 09:38 — forked from ttscoff/brettquix.txt
Gio's Quix File
@Gio's searches
@Gio's custom searches
go https://duckduckgo.com/?q=%21%20%s Open first result (DuckDuckGo)
b https://duckduckgo.com/?q=%21%s Bang search (DuckDuckGo)
grep https://www.cueup.com/?q=%s&fq=1 Greplin
ss https://duckduckgo.com/site:%d%20%s Current site (DuckDuckGo)
gh http://github.com/search?q=%s&type=Everything&repo=&langOverride=&start_value=1 Search GitHub (everything)
hints http://hints.macworld.com/search.php?query=%s&keyType=all&datestart=&dateend=&topic=0&type=stories&results=50&mode=search Search Mac OS X Hints
mu http://www.macupdate.com/find/mac/%s Search MacUpdate (Software)
jq http://api.jquery.com/?ns0=1&s=%s&go= Search jQuery API docs
@gglanzani
gglanzani / fontforge.log
Created August 6, 2012 09:53
fontforge log
==> Downloading http://downloads.sourceforge.net/project/fontforge/fontforge-source/fontforge_full-20110222.tar.bz2
Already downloaded: /Library/Caches/Homebrew/fontforge-20110222.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/fontforge/20110222 --enable-double --without-freetype-bytecode --with-python-headers=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 --with-python-lib=-lpython2.7 --enable-pyextension
==> make
( cd Unicode ; make )
ln -s ./po/*.po po
ln: po/de.po: File exists
ln: po/el.po: File exists
ln: po/en_GB.po: File exists
ln: po/es.po: File exists