Skip to content

Instantly share code, notes, and snippets.

Adrian Wan awan1

Block or report user

Report or block awan1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@awan1
awan1 / ls_with_ignore_and_print
Last active Aug 23, 2016
An improved ls command that can exclude files matching given globs and shows how many of each file were excluded.
View ls_with_ignore_and_print
###########
## Notes ##
###########
## This shows you how to configure your ls command to not show certain files,
## and tell you how many of those files were omitted. This declutters your ls output.
## To use this, add it to whatever .{profile, alias, rc} file you put your aliases in.
## The ls and find functions here are the GNU variants: the flags needed are not in
## the BSD variant, which is the OSX default.
## So on OSX, you'll need to install GNU ls and GNU find (see http://goo.gl/bDO0ga),
@awan1
awan1 / ask_user_for_selection.py
Last active Oct 30, 2015
Ask user to choose from a list of choices via command line
View ask_user_for_selection.py
"""
Allows choice of options via command line.
Author: awan1
Date: 20151029
"""
import numpy as np
def ask_user_for_selection(choices, choice_text='options'):
@awan1
awan1 / path_join_check.py
Last active Oct 30, 2015
Flexibly check that the result of os.path.join is of a given type.
View path_join_check.py
"""
Wrapper call to os.path.join and os.path.expanduser that checks whether the
returned path is of a given type.
Author: awan1
Date: 20151029
"""
import os
You can’t perform that action at this time.