git config --global user.name "FIRST_NAME LAST_NAME"
git config --global user.email "[email protected]"
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
""" | |
Problem: | |
How to Convert PDF to Image with Python Script ? | |
Installation: | |
I use ubuntu OS 14.04 | |
We use wrapper for ImageMagick [http://www.imagemagick.org/script/index.php] to Convert The PDF file | |
in Python do: | |
$ sudo apt-get install libmagickwand-dev |
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
""" | |
delete all migration files, run it at the top of project folder | |
run with the virtualenvwrapper virtualenv activated | |
TODO: find migration if located on os python folder | |
""" | |
import os | |
import argparse | |
def delete_migrations(folder_path=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
""" | |
delete all compiled binaries files | |
""" | |
import os | |
import argparse | |
def delete_binaries(folder_path=None): | |
""" | |
delete binaries given a folder, if not given, |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Calculate second lowest cost silver plan (SLCSP) | |
https://homework.adhoc.team/slcsp/ | |
The instruction for run program is: | |
python SLCSP_iris9112.py -s files/slcsp.csv -p files/plans.csv -z files/zips.csv | |
""" |
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 requests | |
from requests.exceptions import HTTPError | |
isa = 'https://api.github.com/users/iris9112/gists' | |
santi = 'https://api.github.com/users/rmotr-doesnt-exist/gists' | |
for url in [isa, santi]: | |
try: | |
response = requests.get(url) | |
# If the response was successful, no Exception will be raised |
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
# Minimal example of POO | |
class Person(object): | |
has_animal = False | |
pets = list() | |
def __init__(self, name, last_name): | |
self.name = name | |
self.last_name = last_name |
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
def method_one(): | |
""" | |
Method-1: Using pathlib.Path.mkdir() | |
mkdir(mode=0o777, parents=False, exist_ok=False) | |
These parameters are optional. | |
If mode is given, it determines the file mode and access flags. | |
However, if the path already exists, then it will raise a FileExistsError exception. |