npm install -g cloc # https://www.npmjs.com/package/cloc
sudo apt-get install cloc # Debian, Ubuntu
sudo yum install cloc # Red Hat, Fedora
sudo pacman -S cloc # Arch
sudo pkg install cloc # FreeBSD
sudo port install cloc # Mac OS X with MacPorts
This file contains 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
parser.add_argument('-v', '--verbose', action='count', default=0) | |
parser.add_argument('-q', '--quiet', action='count', default=0) | |
logging_level = logging.WARN + 10*args.quiet - 10*args.verbose | |
# script -vv -> DEBUG | |
# script -v -> INFO | |
# script -> WARNING | |
# script -q -> ERROR | |
# script -qq -> CRITICAL |
This file contains 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
import os | |
DEF_INP = "/dev/input/" | |
DEF_BUS = "/proc/bus/input/devices" | |
def read_device(): | |
fd = os.popen("grep -E 'Handlers|EV=' " + DEF_BUS + " | grep -B1 'EV=120013' | grep -Eo 'event[0-9]+'") | |
events = list(fd.read().split("\n"))[:-1] | |
fd.close() | |
return events | |
print(DEF_INP + read_device()[0]) |
This file contains 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
import logging,inspect | |
def function_logger(file_level, console_level = None): | |
""" | |
Store keys | |
""" | |
function_name = inspect.stack()[1][3] | |
logger = logging.getLogger(function_name) | |
logger.setLevel(logging.DEBUG) | |
if console_level != None: |
This file contains 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
Create stuff based on user's browsing history that suggests a user to take some interesting courses online. |
- Git installation.
- http://tinyurl.com/epworkshop2016 for the invitation.
- Git 2.9 release note.
Faker - pip install Faker
Python
OlderNewer