Skip to content

Instantly share code, notes, and snippets.

View blackfist's full-sized avatar

Kevin Thompson blackfist

View GitHub Profile

Keybase proof

I hereby claim:

  • I am blackfist on github.
  • I am kev (https://keybase.io/kev) on keybase.
  • I have a public key whose fingerprint is A1F2 5046 F79D B2C3 61F6 A9FB 1BF2 F63F BB73 1AFA

To claim this, I am signing this object:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blackfist
blackfist / swat.md
Last active August 29, 2015 14:03
A letter that I wrote to my elected officials about the excessive use of SWAT teams

I used the electronic forms to reach out to my representatives, but I recorded their address here because I use that in the letter

Senator Amy Klobuchar
302 HART SENATE OFFICE BUILDING
WASHINGTION DC 20510

Senator Al Franken
302 HART SENATE OFFICE BUILDING
WASHINGTION DC 20510

@blackfist
blackfist / unordered_bar_chart.R
Created July 13, 2014 13:47
I'd like to know why this bar chart isn't sorted even though the data frame that I sent to it is.
library(ggplot2)
library(plyr)
library(verisr)
load("~/Documents/vzdata/verisr_object/verisr2.dat")
patterns <- as.data.frame(table(vz$pattern))
names(patterns) <- c("Pattern", "Count")
patterns <- arrange(patterns, desc(Count))
print(patterns)
> source('~/.active-rstudio-document')
[1] Dimensions of the verisr object
[1] 3544 1841
[1] Number of NAs in the victim.industry field:
[1] 0
[1] Number of NAs in the victim.industry2 field:
[1] 3432
library(verisr)
library(RColorBrewer)
library(ggplot2)
vcdb <- json2veris('~/Documents/development/python/vcdb/data/json')
origin <- getenum(vcdb, "actor")
colors <- brewer.pal(3, "Set2")
gg <- ggplot(origin, aes(x=enum, y=freq)) + geom_bar(stat="identity", fill=colors[1])
@blackfist
blackfist / weird_sort.json
Created August 31, 2014 03:55
When I sort a data frame and plot it the values are properly sorted but the labels are not.
{
"metadata": {
"name": "",
"signature": "sha256:70ec5770cd4e35c7a408514277aa748a06612e2b2f4441a5efd73e02746d1a6b"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@blackfist
blackfist / extraction.ipynb
Created December 15, 2014 16:19
Code to extract article text from VCDB
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am blackfist on github.
  • I am kev (https://keybase.io/kev) on keybase.
  • I have a public key whose fingerprint is A1F2 5046 F79D B2C3 61F6 A9FB 1BF2 F63F BB73 1AFA

To claim this, I am signing this object:

New Years Resolutions for 2015

Mandarin Language resolutions

  • Acquire an additional 300 hours of practice, bringing my total to 900 hours.
  • End the year knowing at least 500 simplified characters
  • Finish reading one chinese novel (short)
  • Have at least 1 hour long conversation with an native speaker in each month of 2015