Skip to content

Instantly share code, notes, and snippets.

View kf0jvt's full-sized avatar

Kevin Thompson kf0jvt

View GitHub Profile
{
"type": "text",
"from": {"data": "site"},
"properties": {
"enter": {
"text":"This is some text.",
"align": "center",
"baseline": "bottom",
"fill": {"value": "#000"}
}
@kf0jvt
kf0jvt / schema_update.py
Created February 12, 2014 21:01
Add a region code to veris - experimental
# Download https://raw2.github.com/lukes/ISO-3166-Countries-with-Regional-Codes/master/all/all.json
# and save as all.json in the same folder
import json
import os
from datetime import datetime
import uuid
# i = getIncident('blahblahblah.json')
def getIncident(inString):
return json.loads(open(inString).read())
@kf0jvt
kf0jvt / git.md
Last active August 29, 2015 13:56
Git stuff I don't want to forget

fetch a remote branch

git checkout --track origin/daves_branch

Undo a commit from a few commits ago that was pushed up to github. Be warned that if you do this everyone will have to basically blow away their local copy of the repo and do a fresh git pull.

git rebase -i HEAD~4 
git push --force

That will show all the commits going back 4 and let you pick which ones you want to keep. A better way might be to delete the files, then you wont be rewriting history

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import simplejson as sj
import os
from jsonschema import validate, ValidationError
sk = sj.loads(open('verisc.json').read())
enum = sj.loads(open('verisc-enum.json').read())
os.chdir('/Documents/development/python/vcdb/data/json')
# All of the action enumerations

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:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kf0jvt
kf0jvt / 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

@kf0jvt
kf0jvt / 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)