I hereby claim:
- I am jsonbecker on github.
- I am jsonbecker (https://keybase.io/jsonbecker) on keybase.
- I have a public key ASDIgFzpTFWImOtO0Dw5-XJVu-LiDxUfqB53ZkGSUzla7go
To claim this, I am signing this object:
{{ partial "head.html" . }} | |
<body> | |
<div class="content list h-feed"> | |
{{ partial "header.html" . }} | |
{{ $paginator := .Paginate (where .Site.Pages "Type" "post").ByDate.Reverse 1 }} | |
{{ range $paginator.Pages }} | |
{{ partial "li.html" . }} | |
{{ end }} | |
{{ partial "pagination.html" . }} | |
{{ partial "footer.html" . }} |
Mix.install([{:httpoison, "~> 2.0"}]) | |
defmodule ADNDownloader do | |
require HTTPoison | |
@base_url "https://adn.micro.blog/" | |
def get_posts(user_name) do | |
url = @base_url <> "users/" <> String.at(user_name, 0) <> "/" <> user_name <> ".txt" |
<a href="{{ .Get "src" }}" | |
class="glightbox" | |
{{ if .Get "gallery"}} | |
data-gallery="{{ .Get "gallery" }}" | |
{{ end }} | |
{{ if or (.Get "title") (.Get "description") }} | |
data-glightbox="title:{{ .Get "title" | default "" }};description:{{ .Get "description" | default "" }}" | |
{{end}} | |
> | |
<img src="{{ .Get "src" }}" |
library(ggplot2) | |
df <- data.frame(type = c(rep('Elementary', 2), rep('Middle', 2), rep('High', 2)), | |
included = rep(c('included','excluded'),3), | |
dollars = c(1000, 2500, 4000, 1000, 3000, 2800)) | |
ggplot(data = df, aes(type, dollars, fill = included)) + | |
geom_bar(position = 'fill', stat = 'identity') + | |
geom_text() |
I hereby claim:
To claim this, I am signing this object:
# Ever want to log how long someting takes? I know I do. timing() | |
# isn't about benchmarking, it's about getting feedback from long running | |
# tasks, especially if they are scheduled in production. Anyway, I love | |
# this function because it's a simple wrapper that can go around anything. | |
# I use it inside our tools at Allovue when extracting data to get things | |
# like this: | |
#> accounts <- extract_data(config_file$accounts) | |
# Starting queries/accounts.sql at: Mon Sep 19 15:27:34 2016 | |
# Completed at: Mon Sep 19 15:28:14 2016 |
import sys | |
import os, shutil, time | |
import subprocess | |
import os.path | |
import exifread | |
from datetime import datetime | |
def photoDateSIPS(f): | |
"Return the date/time on which the given photo was taken." |
<!-- In your content.md meta data include a link attribute like this --> | |
Link: http://www.getpelican.com | |
<!-- In your articles.html template --> | |
{% block content %} | |
{% if article.link %} <!-- checks if article has link as a metadata attribute --> | |
<h1 class="title"><a href='{{ article.link }}' title="Link">{{ article.title }}</a></h1> | |
{% else %} |
cutoff_matrix <- function(df, classifier, outcome, breaks=seq(1,0,-.01)){ | |
results <- data.frame(cutoff=vector(mode='numeric', length=length(breaks)), | |
true_pos=vector(mode='numeric', length=length(breaks)), | |
true_neg=vector(mode='numeric', length=length(breaks)), | |
false_pos=vector(mode='numeric', length=length(breaks)), | |
false_neg=vector(mode='numeric', length=length(breaks))) | |
for(i in seq(1, length(breaks))){ | |
value <- breaks[i] | |
j <- data.frame(table(df[[classifier]]>value, df[[outcome]])) | |
results[i,1] <- value |
modal_person_attribute <- function(df, attribute){ | |
# df: rbind of all person tables from all years | |
# attribute: vector name to calculate the modal value | |
# Calculate the number of instances an attributed is associated with an id | |
dt <- data.table(df) | |
mode <- dt[, rle(as.character(.SD[[attribute]])), by=sasid] | |
setnames(mode, c('sasid', 'counts', as.character(attribute))) | |
setkeyv(mode, c('sasid', 'counts')) | |
# Only include attributes with the maximum values. This is equivalent to the | |
# mode with two records when there is a tie. |