Skip to content

Instantly share code, notes, and snippets.

@jquacinella
jquacinella / python-cheat-sheet-basic.py
Last active September 20, 2016 22:49 — forked from filipkral/python-cheat-sheet-basic.py
Basic Python Cheat Sheet
#!/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 February 3, 2023 15:51
Violin Plots for Weighted Data in Matplotlib
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 June 23, 2015 19:36
Wercker.yml file w/ Private Registry
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 July 15, 2021 17:18
List / Set of Bad Usernames
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"
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>