Skip to content

Instantly share code, notes, and snippets.

View python-cheat-sheet-basic.py
#!/usr/bin/env python
"""Basic Python Cheat Sheet by Filip Kral on 2015/02/16"""
""" Updated by James Quacinella for MIMS:5001 """
"""
Python is a cross-platform, interpreted, object-oriented programming language.
That means you can run it on Linux, Windows, Mac, and other platforms,
you don't need to compile your code to execute it because it is compiled on
the fly, and you can use classes and objects.
@jquacinella
jquacinella / violin_weighted_plot.py
Last active Jun 10, 2020
Violin Plots for Weighted Data in Matplotlib
View violin_weighted_plot.py
import weighted
from matplotlib.cbook import violin_stats
from scipy import stats
import statsmodels.api as sm
def vdensity_with_weights(weights):
''' Outer function allows innder function access to weights. Matplotlib
needs function to take in data and coords, so this seems like only way
to 'pass' custom density function a set of weights '''
@jquacinella
jquacinella / wercker.yml
Created Jun 23, 2015
Wercker.yml file w/ Private Registry
View wercker.yml
build:
box:
id: source-container
username: wercker
password: ****
tag: 0.3
registry: https://portal.credacious.com
#services:
# - wercker/redis
steps:
@jquacinella
jquacinella / badUsername.py
Last active Jul 15, 2021
List / Set of Bad Usernames
View badUsername.py
import pickle
# Create initial list by merging some sources together
# * https://gist.github.com/caseyohara/1453705
# * http://www.ietf.org/rfc/rfc2142.txt
# * https://docs.google.com/spreadsheet/ccc?key=0At1hhL-iEnOHdGpEd0xjUnJvc2EwbVVpUUo2TkhYTlE#gid=0
# * http://blog.postbit.com/reserved-username-list.html
badNames = ["INFO","MARKETING","SALES","SUPPORT","ABUSE","NOC","SECURITY","POSTMASTER","HOSTMASTER","USENET","NEWS","WEBMASTER","WWW","UUCP","FTP","SMTP","LIST","LIST-REQUEST","admin","blog","dev","ftp","mail","pop","pop3","imap","smtp","stage","stats","status","www","beta","about","access","account","accounts","add","address","adm","admin","administration","adult","advertising","affiliate","affiliates","ajax","analytics","android","anon","anonymous","api","app","apps","archive","atom","auth","authentication","avatar","backup","banner","banners","bin","billing","blog","blogs","board","bot","bots","business","chat","cache","cadastro","calendar","campaign","careers","cgi","client","cliente","code"
View Python Notepad Bookmarklet
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/python");</script>