I hereby claim:
- I am odedlaz on github.
- I am odedlaz (https://keybase.io/odedlaz) on keybase.
- I have a public key ASAU1lUk2Ot0OhWdA-AB6YzuAJKxIXTvwesw-v6GAZ1rlAo
To claim this, I am signing this object:
from __future__ import print_function | |
from functools import wraps | |
from io import SEEK_END | |
from re import compile | |
from sys import argv | |
from time import sleep | |
RE_TYPE = type(compile("")) |
#!/usr/bin/env bash | |
filename="$1" | |
# solution using bash | |
count=0 | |
while read -r line | |
do | |
if echo "$line" | grep "CHAPTER" > /dev/null; then | |
((count++)) |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/zsh | |
function update_python_packages { | |
USERNAME=$(logname) | |
# run command as the user who logged in. see: https://goo.gl/akX2eo | |
echo "Updating neovim python$1 libraries ..." | |
source /opt/nvim/python$1/bin/activate | |
pip install -u --upgrade pip &> /dev/null | |
packages_to_install=$(pip list --outdated --format=legacy) |
import os | |
def getenv(varname, default=None, typecast_fn=None): | |
""" | |
Return the value of the environment variable varname if it exists, or default if it doesn't. | |
default defaults to None. | |
:typecast_fn: a function that performs the typecast. if not supplied, defaults to type(value) | |
""" | |
from tesserocr import PyTessBaseAPI | |
import sys | |
import os | |
# tesserocr -> https://pypi.python.org/pypi/tesserocr | |
# cython -> https://pypi.python.org/pypi/Cython | |
# Pillow -> https://pypi.python.org/pypi/Pillow | |
if len(sys.argv) != 2: | |
print("you need to pass the path to the image as first argument") |
# The following adds syntax highlighting to various programming languages | |
# Credit goes to Ter Smitten: https://goo.gl/64YU4u | |
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s" | |
export LESS=' -R ' | |
# The following adds syntax highlighting to man pages | |
# Credit goes to Todd Weed: https://goo.gl/ZSbwZI | |
export LESS_TERMCAP_mb=$'\e[01;31m' # begin blinking | |
export LESS_TERMCAP_md=$'\e[01;38;5;74m' # begin bold | |
export LESS_TERMCAP_me=$'\e[0m' # end mode |
from __future__ import print_function | |
import os | |
import sys | |
import six | |
from time import time | |
from random import choice | |
from types import CodeType, FunctionType | |
from functools import wraps | |
from string import Formatter |
name = "oded" | |
age = 26 | |
print("My name is: {name}, my age is: {age} and 2*3={2*3}!") | |
# My name is oded, my age is: 26 and 2*3=6! |
def awesome_print(text, **kwargs): | |
text = "a format with {GENERATED_NAME} and {ANOTHER_GENERATED_NAME}" | |
std_print(text.format(GENERATED_NAME=(STATEMENT), ANOTHER_GENERATED_NAME=(ANOTHER_STATEMENT), **kwargs)) |