Skip to content

Instantly share code, notes, and snippets.

View cbuntain's full-sized avatar

Cody Buntain cbuntain

View GitHub Profile
#!/bin/sh
# Dropbox setup on a headless Ubuntu Server
# Script written by Jesse B. Hannah (http://jbhannah.net) <jesse@jbhannah.net>
# Based on http://wiki.dropbox.com/TipsAndTricks/UbuntuServerInstall
###
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
### Keybase proof
I hereby claim:
* I am cbuntain on github.
* I am cbuntain (https://keybase.io/cbuntain) on keybase.
* I have a public key whose fingerprint is 4120 BD1D DA9C 8D23 BCAE D393 564A 467E E062 C88C
To claim this, I am signing this object:
@cbuntain
cbuntain / gist:f16359906f4a6c52544c
Created January 15, 2015 20:50
Tweet Frequency in Spark
import scala.collection.JavaConverters._
import org.apache.spark._
import org.apache.spark.rdd.RDD
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.Locale
import java.lang.reflect.Type

Instructions for MediaScores on Kong

  • First, we need to create some files that will specify R settings.

    • Create the file ~/.R/Makevars and add the following lines to it (necessary for building mediascores):

        CXX14FLAGS = -DSTAN_THREADS
        CXX14FLAGS += -O3 -march=native -mtune=native
        CXX14FLAGS += -fPIC
      
@cbuntain
cbuntain / agreement.py
Created March 19, 2020 18:38
Example of using NLTK's agreement package to calculate agreement scores for an annotation task
#
# Author: Cody Buntain
# Date: 19 March 2020
#
# Description:
# This code is an example of uysing the agreement package
#. in NLTK to calculate a number of agreement metrics on
#. a set of annotations. Currently, this code will work
#. with two annotators and multiple labels.
#. You can use Fleiss's Kappa or Krippendorf's Alpha if you
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cbuntain
cbuntain / crisisfacts.downloader.py
Last active July 11, 2022 18:12
CrisisFACTS Direct Download
import json
import requests
import pandas as pd
### Necessary Credentials
credentials = {
"institution": "University of Maryland, College Park", # University, Company or Public Agency Name
"contactname": "Cody Buntain", # Your Name
"email": "cbuntain@umd.edu", # A contact email address
"institutiontype": "Research" # Either 'Research', 'Industry', or 'Public Sector'