Skip to content

Instantly share code, notes, and snippets.

Avatar

Herb Susmann herbps10

View GitHub Profile
@herbps10
herbps10 / admin.py
Created Jun 18, 2015
Setting up SQLAlchemy with Application Factory pattern and Blueprints
View admin.py
from flask import current_app, Blueprint, render_template
from database import db_session
from model import Product
admin = Blueprint('admin', __name__, url_prefix='/admin')
@admin.route('/')
def index():
product = db_session.query(Product).first()
View raytracer.sh
#!/bin/bash
#
#
# Bash Raytracer
# Herb Susmann
#
PIXEL_INCR="0.05"
# Object type IDs
@herbps10
herbps10 / .block
Last active Oct 25, 2016
IQ Distribution Master
View .block
license: mit
@herbps10
herbps10 / .block
Last active Nov 3, 2016
IQ Distribution Mean/SD Slider
View .block
license: mit
border: no
@herbps10
herbps10 / .block
Last active Nov 3, 2016
IQ with comparison
View .block
license: mit
View .block
license: mit
View twitter-cloud.R
library(tidyverse)
library(tm)
library(SnowballC)
library(wordcloud)
library(RColorBrewer)
setup_twitter_oauth(consumer_key = "...", consumer_secret = "...")
results <- searchTwitter("#EHSFEST", n = 1000) %>%
twListToDF()
@herbps10
herbps10 / twitter-bulk-add-to-list.R
Last active Dec 8, 2016
Twitter Bulk Add to List
View twitter-bulk-add-to-list.R
#
# Adds twitter users to a twitter list in bulk
#
library(twitteR)
query <- "#EHSFEST"
screen_name <- "herbps10"
list_slug <- "ehsfest"
setup_twitter_oauth(consumer_key = "...", consumer_secret = "...")
@herbps10
herbps10 / package-downloads.R
Last active Feb 25, 2018
R Package Download Graph
View package-downloads.R
library(tidyverse)
log <- cranlogs::cran_downloads(packages="RNHANES", from="2016-09-28")
ggplot(log, aes(x = date, y = cumsum(count))) + geom_point()
sum(log$count)
You can’t perform that action at this time.