Skip to content

Instantly share code, notes, and snippets.

@egabancho
egabancho / compare.py
Created June 24, 2016 13:01 — forked from astanin/compare.py
Compare two aligned images of the same size
#!/usr/bin/env python
"""Compare two aligned images of the same size.
Usage: python compare.py first-image second-image
"""
import sys
from scipy.misc import imread
from scipy.linalg import norm
@egabancho
egabancho / marc_status.py
Created May 3, 2016 14:07 — forked from kaplun/marc_status.py
Analysis tool to find the current MARC usage of an Invenio installation (to understand common values, formats and outliers)
#!/usr/bin/env python
import sys
from invenio.dbquery import run_sql
from invenio.search_engine import get_tag_name
from invenio.search_engine import get_collection_reclist
from invenio.intbitset import intbitset
collection = sys.argv[1]
@egabancho
egabancho / marc_repeatable.py
Created May 3, 2016 14:07 — forked from kaplun/marc_repeatable.py
Analysis tool to get statistics on repeatable fields and subfields of an Invenio instance
#!/usr/bin/env python
from invenio.search_engine import get_collection_reclist, get_record
from invenio.intbitset import intbitset
from click import progressbar
collection = sys.argv[1]
recids = list(get_collection_reclist(collection))
recids.reverse()

This Gist contains the script and generated output file for an Acer B276HUL.

The pre-generated file below is known to work with:

  • OS X Mavericks
  • OS X Yosemite
  • OS X El Capitan

For El Capitan:

  1. Restart your Mac while holding Command-R: this puts your Mac into Recovery Mode.
@egabancho
egabancho / clone.rb
Created April 7, 2016 19:58 — forked from imathis/clone.rb
Clone all repositories under a user or organization
#!/usr/bin/ruby
require 'open-uri'
require 'json'
user = 'imathis'
repos = open("https://api.github.com/users/#{user}/repos") { |f|
JSON.parse(f.readlines.join)
}
@egabancho
egabancho / tmux_local_install.sh
Last active January 29, 2016 09:10 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8