A simple Datatable web application to maintain customer details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |