Skip to content

Instantly share code, notes, and snippets.

Avatar
🎸
Microsoft Musical

Sean Kelley seangtkelley

🎸
Microsoft Musical
View GitHub Profile
@seangtkelley
seangtkelley / pi_dec_1m_digits_dist.ipynb
Last active Nov 24, 2019
Distribution of One Million Digits of Pi
View pi_dec_1m_digits_dist.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View late-night-sexism_wordclouds.py
female_mask = np.array(Image.open(os.path.join(os.getcwd(), "female_mask.jpg")))
male_mask = np.array(Image.open(os.path.join(os.getcwd(), "male_mask.jpg")))
female_wordcloud = WordCloud(background_color="white", max_words=1000, mask=female_mask, margin=10,random_state=1).generate(female_text)
male_wordcloud = WordCloud(background_color="white", max_words=1000, mask=male_mask, margin=10,random_state=1).generate(male_text)
f, (ax1, ax2) = plt.subplots(1, 2, sharex=True)
f.set_size_inches(18, 20.0)
ax1.imshow(male_wordcloud, interpolation="bilinear")
ax1.set_title('Male Wordcloud', fontsize=36)
View late-night-sexism_stopwords.py
cachedStopWords = stopwords.words("english")
punct = set(string.punctuation)
female_text = ' '.join(female_titles)
male_text = ' '.join(male_titles)
female_text = ''.join(ch for ch in female_text if ch not in punct)
male_text = ''.join(ch for ch in male_text if ch not in punct)
female_text = ' '.join([word for word in female_text.split() if word not in cachedStopWords])
View late-night-sexism_search-titles.py
census_surnames = pd.read_csv('app_c.csv')
census_firstnames = pd.read_csv('census-derived-all-first.csv')
firsts_lower = [str(name).lower() for name in list(census_firstnames.name)]
lasts_lower = [str(name).lower() for name in list(census_surnames.name)]
d = gender.Detector()
male_titles = []
female_titles = []
View late-night-sexism_playlist1.py
plurl = "https://www.youtube.com/playlist?list=UUi7GJNg51C3jgmYTUwqoUXA"
playlist = pafy.get_playlist2(plurl)
playlist
View late-night-sexism_imports.py
import pafy
import pandas as pd
import numpy as np
from PIL import Image
import os
import gender_guesser.detector as gender
from wordcloud import WordCloud
from nltk.corpus import stopwords
import matplotlib.pyplot as plt
from tqdm import tqdm
@seangtkelley
seangtkelley / gitkraken-install.sh
Last active Oct 3, 2019 — forked from aelkz/[FEDORA] gitkraken
Install Script for Gitkraken on Fedora 27 + Launcher Icon
View gitkraken-install.sh
#!/bin/bash
# Enter /opt folder (common folder for user installed programs)
# This script assumes you have proper permissions on /opt
cd /opt
# Download GitKraken
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
# Extract the Kraken into /opt directory