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 is_triangle(w): | |
return sum([ord(c)-64 for c in w]) in TN | |
L = list(eval(open('words.txt').readlines()[0])) #loading data | |
# creating triangle number list as i don't want to check triagulity every time | |
i,TN = 0,[] | |
for j in range(1,30): | |
i += j; TN.append(i) | |
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 python2.7 | |
""" | |
Parallel RSS-Feed Downloader | |
---------------------------- | |
Download contents by grabbing links from a given RSS-feed. | |
Works over HTTP,FTP,HTTPS protocol transparently. | |
Currently, works on Linux, Mac OSX, and possibly on other Unix as well. | |
But, _NOT_ on Windows * yet. | |
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
""" | |
=============== | |
pep8_tonizer.py | |
=============== | |
This script can be used to make python code, that is being edited on Notepad++, \ | |
to comply with infamous PEP8 coding style [http://bit.ly/pep8] | |
By default, autopep8 only makes whitespace changes. So does this script. | |
However, this script depends on following: | |
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
""" | |
author: Khaled Monsoor <[email protected]> | |
modified: 09-Dec-2015 | |
license: The MIT License | |
""" | |
import sys | |
from datetime import datetime | |
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/python | |
__author__ = 'Khaled Monsoor <[email protected]>' | |
__license__ = 'The MIT License: <http://kmonsoor.mit-license.org/>' | |
import json | |
import requests | |
def stackoverflow_to_github_user(stackoverflow_id): | |
''' |
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/python | |
__author__ = 'Khaled Monsoor <[email protected]>' | |
__license__ = 'The MIT License: <http://kmonsoor.mit-license.org/>' | |
import requests | |
import json | |
def github_username_to_email(username): | |
''' |
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
''' | |
SOURCE: http://pastebin.com/48G4MS8E | |
The code below was used to allow verified domain users the ability to add sites to a Squid Proxy whitelist via a secure web form. | |
It deals with Flask-Apache-SSL-LDAP-Email-Sockets-Logging and other topics | |
I make no claims as to it's suitability for other purposes. | |
I am not posting this for anyones approval nor is it here to be shot down. |
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
# initial version: http://stackoverflow.com/a/7936523/617185 \ | |
# by Mikhail Kashkin(http://stackoverflow.com/users/85739/mikhail-kashkin) | |
def get_yt_video_id(url): | |
"""Returns Video_ID extracting from the given url of Youtube | |
Examples of URLs: | |
Valid: | |
'http://youtu.be/_lOT2p_FCvA', | |
'www.youtube.com/watch?v=_lOT2p_FCvA&feature=feedu', |
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
[user] | |
email = [email protected] | |
name = Khaled Monsoor | |
[credential "https://github.com"] | |
username = kmonsoor | |
[alias] | |
s = status | |
c = commit | |
f = fetch |
OlderNewer