Skip to content

Instantly share code, notes, and snippets.

View murali44's full-sized avatar

Murali Allada murali44

View GitHub Profile
@murali44
murali44 / .bash_profile
Created August 11, 2020 15:41
Terminal Profile
# Copy to ~/.bash_profile
export PS1="\w$ "
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[$(tput bold)\]\[\033[38;5;3m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
export CLICOLOR=1

CRUD using Datatable

A simple Datatable web application to maintain customer details.

A Pen by Osmosys on CodePen.

License.

def namedlist(typename, field_names):
"""Returns a new subclass of list with named fields.
>>> Point = namedlist('Point', ('x', 'y'))
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
>>> p[0] + p[1] # indexable like a plain list
33
>>> x, y = p # unpack like a regular list