Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am alexrrr on github.
* I am ardoodle ( on keybase.
* I have a public key ASBjTXT7ru8KIzuW-MTtGi6Ejhnh_5spaj6H9Tx9ldfvIQo
To claim this, I am signing this object:
AlexRRR / Calculator.markdown
Created November 14, 2015 20:20
AlexRRR / gist:7f5de57ea65adcb1cb5c
Last active August 29, 2015 14:01
MongoDB: Find which DB contains a collection
var findCollection = function(colName) {
var db_list = db.adminCommand('listDatabases')
var allDbs = { return (x['name']) }) {
db = db.getMongo().getDB(x);
var cols = db.getCollectionNames();
if (cols.indexOf(colName) > 0) {
AlexRRR /
Created January 29, 2014 08:29
handy script for linting and parsing your currently modified files.
git status|grep modified|awk '{$1=$1}{ print }'|cut -d' ' -f2|while read -r line; do
echo "Linting and parsing $line ..."
puppet-lint --with-filename --no-80chars-check $line
puppet parser validate $line
AlexRRR /
Created October 19, 2012 11:49 — forked from pamelafox/
Python list of country codes, names, continents, capitals, and pytz timezones
countries = [
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'},
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'},
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"},
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'},
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'},
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'},
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai