Skip to content

Instantly share code, notes, and snippets.

View eglassman's full-sized avatar
💭
I may be slow to respond.

Elena Glassman eglassman

💭
I may be slow to respond.
View GitHub Profile
@aronwc
aronwc / lda.py
Last active April 30, 2024 06:54
Example using GenSim's LDA and sklearn
""" Example using GenSim's LDA and sklearn. """
import numpy as np
from gensim import matutils
from gensim.models.ldamodel import LdaModel
from sklearn import linear_model
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import CountVectorizer
@roblanf
roblanf / speciesplot
Last active October 24, 2018 16:04
Make a speciesplot in R
# Create a scatterplot with any species as the data points.
# To choose your species, go here: http://phylopic.org/ , then enter the name of the spp you want. Click on the image and click 'thumbnail', click on the picture, and then copy the link in the address bar of your browser. It should end with 'thumb.png' Paste it in place of the link below.
library(TeachingDemos)
library(png)
# Paste a link to a png of your favourite animal here. This will be an aardvarkplot. Make sure it ends with .thumb.png.
# If it doesn't end with .thumb.png reread the instructions above and try again.
link = "http://phylopic.org/assets/images/submissions/cfee2dca-3767-46b8-8d03-bd8f46e79e9e.thumb.png"
@natematias
natematias / 365grateful_on_twitter.py
Last active August 29, 2015 14:04
Analyze 365Grateful on Twitter
#adapted from minus_context
import nltk
import feedparser
import random
import twitter
import yaml
import string
import re
from urlparse import urlparse
@davidbau
davidbau / googlesender.py
Last active September 19, 2024 17:10
Python 2 script for generating a JavaScript/jQuery function for submitting to a Google Form
# Google form submit-maker.
#
# Usage: python googlesender.py https://docs.google.com/forms/d/e/1.../viewform
#
# Point this python file at a live Google forms URL, and it will generate
# code for a Javascript function that submits to that form cross-domain.
#
# Notes:
# - The form should be created with "short answer text" questions.
# - The viewform URL to scrape is the link shared when the form is sent.
@drzax
drzax / .block
Last active April 4, 2025 07:20
Narrative Charts
license: mit
scrolling: true
height: 300
# -*- coding: utf-8 -*-
'''
Created on May 27, 2016
@author: abgupta
'''
from selenium.webdriver import Firefox
from selenium.webdriver.support.ui import WebDriverWait
import time, sys, traceback
from HTMLParser import HTMLParser
@alltom
alltom / twoman.eve
Last active October 19, 2016 07:53
# [Two-Man Rule](https://en.wikipedia.org/wiki/Two-man_rule)
## Model
Create two locks.
```
commit @model
[#lock name: "Lock 1", locked: true]
[#lock name: "Lock 2", locked: true]
```
Unlock locks when their key is turned.
THE WHITE HOUSE Office of the Press Secretary
For Immediate Release January 20, 2017
EXECUTIVE ORDER
MINIMIZING THE ECONOMIC BURDEN OF THE PATIENT PROTECTION AND AFFORDABLE CARE ACT PENDING REPEAL
By the authority vested in me as President by the Constitution and the laws of the United States of America, it is hereby ordered as follows:
Section 1. It is the policy of my Administration to seek the prompt repeal of the Patient Protection and Affordable Care Act (Public Law 111-148), as amended (the "Act'). In the meantime, pending such repeal, it is imperative for the executive branch to ensure that the law is being efficiently implemented, take all actions consistent with law to minimize the unwarranted economic and regulatory burdens of the Act, and prepare to afford the States more flexibility and control to create a more free and open healthcare market.
Sec. 2. To the maximum extent permitted by law, the Secretary of Health and Human Services (Secretary) and the heads of all other executive department
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">