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 <k@kmonsoor.com>' | |
__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
#!/usr/bin/python | |
__author__ = 'Khaled Monsoor <k@kmonsoor.com>' | |
__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
""" | |
author: Khaled Monsoor <k@kmonsoor.com> | |
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
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
######### | |
# Aliases | |
######### | |
alias ll="ls -lhA" | |
alias g="git" | |
alias ..="cd .." | |
alias mkdir="mkdir -pv" | |
alias fhere="find . -name " | |
alias myip="curl http://ipecho.net/plain; echo" |
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 = me@mydomain.com | |
name = Khaled Monsoor | |
[credential "https://github.com"] | |
username = kmonsoor | |
[alias] | |
s = status | |
c = commit | |
f = fetch |
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
reader = csv.DictReader(open('c:\Book1.csv')) | |
of = open('out.tsv') | |
writer = csv.writer(of) | |
orgs = ['center of', 'center for', 'commitee for', | |
'commitee of', 'organization', 'ministry of', 'ministry for', | |
'department', ] | |
for row in reader: | |
if any(x in row['Definition'].lower() for x in orgs): | |
# print {row['Acronym']: {'full-form': row['Definition'], 'comment': row['Comments']}} | |
writer.writerow(row['Acronym'], '\t', row['Definition']) |
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. |
I hereby claim:
- I am kmonsoor on github.
- I am kmonsoor (https://keybase.io/kmonsoor) on keybase.
- I have a public key whose fingerprint is AE6A FBAA F2F3 D881 EF46 1378 77FF A3EC 79A6 F16D
To claim this, I am signing this object:
OlderNewer