Skip to content

Instantly share code, notes, and snippets.

View davydany's full-sized avatar

David Daniel davydany

View GitHub Profile
@davydany
davydany / dirxpath.sh
Created March 3, 2014 17:08
Rip through XML files in a Directory with XPATH query with XMLStarlet
## DirXPath
## --------
##
## Requirements:
## =============
## Ensure that XMLStarlet is installed on your machine (http://xmlstar.sourceforge.net/)
##
## Install
## =======
## Put the following in your .bashrc (Linux/Unix/Cygwin/MinGW) or .bash_profile (Mac) file. Then source the file.
@davydany
davydany / timeit.py
Created February 20, 2014 22:18
Timeit Method Decorator
import time
def timeit(func=None,loops=1,verbose=False):
if func != None:
def inner(*args,**kwargs):
sums = 0.0
mins = 1.7976931348623157e+308
maxs = 0.0
@davydany
davydany / .bashrc
Last active March 16, 2017 21:21
.bashrc
#########################################
## DAVID'S BASH_PROFILE
#########################################
# Sys Vars
user=''
pass=''
# XMLStarlet
@davydany
davydany / .vimrc
Created January 14, 2014 04:44
My .vimrc
set nu
set smarttab
set expandtab
set autoindent
set nocompatible " choose no compatibility with legacy vi
syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
filetype plugin indent on " load file type plugins + indentation
@davydany
davydany / show_map.py
Created September 26, 2012 17:06
Preparing data to plot contours in Matplotlib's Basemap
# More Info: http://davydany.com/post/32287214449/matplotlibs-basemap-plotting-a-list-of-latitude
def show_map(self, a):
# 'a' is of the format [(lats, lons, data), (lats, lons, data)... (lats, lons, data)]
lats = [ x[0] for x in a ]
lons = [ x[1] for x in a ]
data = [ x[2] for x in a ]
lat_min = min(lats)
lat_max = max(lats)