Skip to content

Instantly share code, notes, and snippets.

Herb Susmann herbps10

Block or report user

Report or block herbps10

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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 primary_polls.R
library(tidyverse)
library(rstan)
library(extrafont)
options(mc.cores = 4)
flat_colors <- c(
asbestos = "#7f8c8d",
purple = "#8e44ad"
View primary_polling.R
library(tidyverse)
library(extrafont)
library(rstan)
options(mc.cores = 4)
# Color scheme (flatuicolors.com)
flat_colors <- c(
gray = "#7f8c8d",
purple = "#8e44ad"
View Unsplash Clusters
[{"counts": [0.6145864661654136, 0.2018045112781955, 0.18360902255639097], "clusters": [[180.46978223635966, 17.494250061170842, 30.6598972351362], [134.69150521609527, 117.99403874814013, 118.58047690014729], [38.08599508599687, 16.957411957411665, 22.646191646190612]], "url": "photo-1457419655743-2e0acc6b5122"}, {"counts": [0.9143939393939394, 0.08181818181818182, 0.003787878787878788], "clusters": [[2.3373094764735303, 0.4262756792579032, 0.4671968190855186], [93.09833024118655, 6.63079777365494, 6.4230055658627325], [242.64000000000007, 135.32000000000005, 121.64000000000001]], "url": "photo-1535868463750-c78d9543614f"}, {"counts": [0.5601503759398496, 0.30030075187969923, 0.13954887218045112], "clusters": [[88.69284561592272, 49.448628294782296, 47.02178590640084], [159.28257613579535, 52.66150773839244, 60.10334498252632], [235.12163616792338, 83.13240043057075, 88.37136706135556]], "url": "photo-1498144846853-60ca2d43853b"}, {"counts": [0.4745901639344262, 0.35262295081967215, 0.17278688524590163], "cl
View Unsplash Thumbnail URLs
https://images.unsplash.com/35/4fjHtYHdRlSemICxjjBu_IMG_8424.jpg?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&ixid=eyJhcHBfaWQiOjc3MzYzfQ
https://images.unsplash.com/photo-1497333975316-f4138c0cca11?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&ixid=eyJhcHBfaWQiOjc3MzYzfQ
https://images.unsplash.com/photo-1544476613-163cfbea9300?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&ixid=eyJhcHBfaWQiOjc3MzYzfQ
https://images.unsplash.com/flagged/photo-1536987569896-7bb4bf443404?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&ixid=eyJhcHBfaWQiOjc3MzYzfQ
https://images.unsplash.com/photo-1509595109082-0125495e3436?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&ixid=eyJhcHBfaWQiOjc3MzYzfQ
https://images.unsplash.com/photo-1558694440-03ade9215d7b?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&ixid=eyJhcHBfaWQiOjc3MzYzfQ
https://images.unsplash.com/photo-1558521594-1e2880f3609e?ixlib=rb-1.2.1&q=80&fm=jpg&cro
View .block
license: mit
height: 700
scrolling: yes
border: yes
@herbps10
herbps10 / .block
Last active Mar 1, 2018
comparison
View .block
license: mit
View isacatinthesink.R
library(rtweet)
library(tidyverse)
library(stringr)
library(cowplot)
library(grid)
library(jpeg)
g <- rasterGrob(readJPEG("cat.jpg"), interpolate = TRUE)
tmls <- get_timelines("isacatinthesink", n = 10)
View common_squirrel.R
library(rtweet)
library(tidyverse)
library(stringr)
library(cowplot)
library(grid)
library(jpeg)
library(lubridate)
library(tidytext)
g <- rasterGrob(readJPEG("common_squirrel.jpg"), interpolate = TRUE)
@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.