I hereby claim:
- I am OzTamir on github.
- I am oztamir (https://keybase.io/oztamir) on keybase.
- I have a public key whose fingerprint is FE51 85BB 5A53 1286 543F 0F50 ABEB 411F C0A0 378B
To claim this, I am signing this object:
| def show_table(titles, rows, table_name=None, sep_rows=False): | |
| ''' | |
| Print a pretty, formatted and spaced table | |
| Parameters: | |
| - header (iterable) : Sequence with titles for each column | |
| - rows (iterable) : Sequence of rows in the table, | |
| must contain len(header) items. | |
| - table_name (str): if the caller want to, print a title | |
| - sep_rows (bool): should the function print a seperetor between values | |
| ''' |
| # Set aliases | |
| # Count lines in a git repository | |
| alias git_lines='git ls-files | xargs wc -l' | |
| # Count lines of code using CLOC | |
| alias cloc='/Applications/CLI/cloc' | |
| # Lines in a project | |
| alias lines="echo 'Total Lines:' ; git_lines | tail -1 ; echo ''; echo 'Statistics:' ; cloc . | tail -8" |
| from PIL import Image | |
| import urllib | |
| import urllib2 | |
| import json | |
| import os | |
| import sys | |
| API_ENDPOINT = 'http://rekognition.com/func/api/?' | |
| TEAR_IMG_URL = 'http://i.imgur.com/7VAlEVf.png' | |
| API_KEY = '' |
| from random import shuffle, randrange | |
| import sys | |
| def get_pool(num_people, num_groups): | |
| ''' Get a list of available slots per group (for 1 round) ''' | |
| slots_per_group = num_people / num_groups | |
| pool = [] | |
| for slot in xrange(slots_per_group): | |
| for group in xrange(1, num_groups + 1): | |
| pool.append(group) |
| from __future__ import division | |
| import sys | |
| def calc_mod(n, m): | |
| ''' Calculate the n-th Catalan mod m''' | |
| res = 1 | |
| tmp = 0 | |
| for k in xrange(2, n + 1): | |
| tmp = ((n + k) / k) % m | |
| res %= m |
| from __future__ import print_function | |
| import mysql.connector | |
| from mysql.connector import errorcode | |
| from mysql.connector.errors import * | |
| import sys | |
| class Database(object): | |
| def __init__(self, dbhost, dbuser, dbpass, dbname, debug=False): | |
| ''' Intialize a Database object and connect to the database ''' | |
| self.host = dbhost |
| import shutil | |
| import os | |
| # The current working directory | |
| dest_dir = os.getcwd() | |
| # The generator that walks over the folder tree | |
| walker = os.walk(dest_dir) | |
| # the first walk would be the same main directory | |
| # which if processed, is |
| import urllib2 | |
| import sys | |
| from bs4 import BeautifulSoup | |
| import re | |
| # Used for formating wiki links | |
| wiki_endpoint = "http://en.wikipedia.org/wiki/" | |
| # Count how many links were visited on the way | |
| counter = 0 | |
| # Regular Pattren for link |
I hereby claim:
To claim this, I am signing this object:
| #include <iostream> | |
| #include <fstream> | |
| #include <string> | |
| #include <regex> | |
| using namespace std; | |
| void parseLinks(string file) { | |
| // Pattern of a HTML link tag | |
| string patt = "(<a href\\s*=\\s*)(\")([^<\"]*)"; | |
| // Regex object to match this pattern |