Skip to content

Instantly share code, notes, and snippets.

View computermacgyver's full-sized avatar

Scott Hale computermacgyver

View GitHub Profile
@computermacgyver
computermacgyver / density_functions.R
Last active June 23, 2016 17:36
Function for R and ggplot2 to create log scale density plots from dataframe, spiting on a factor. #R #ggplot2 #densityPlot #GPLv2 #CHI2014
#!/usr/bin/R
# Functions for R and ggplot2 to create log-scale density plots
# Main function: density.log(...)
# Produce a dataframe used to produce a density plot
# Input:
# data: dataframe,
# var: variable to plot on y-axis
# split: factor to split on
@computermacgyver
computermacgyver / twitter_analysis.R
Last active January 3, 2016 05:29
Analysis of Twitter mentions/retweets network for #CHI2014 paper "Global Connectivity and Multilinguals in the Twitter Network". #R #igraph
#!/usr/bin/R
# Main analysis for "Global Connectivity and Multilinguals in the Twitter Network"
# paper. See http://www.scotthale.net/pubs/?chi2014 for details.
#
# Author: Scott A. Hale (http://www.scotthale.net/)
# License: GPLv2
# If you use this in support of an academic publication, please cite:
#
# Hale, S. A. (2014) Global Connectivity and Multilinguals in the Twitter Network.
@computermacgyver
computermacgyver / pebble-remote.py
Created February 18, 2016 19:44
Python code to use pebble as USB remote clicker (next slide/previosu slide)
#!/usr/bin/env python
#Disconnect your pebble from your phone
#Pair with your computer directly
#Launch the python script. Open the music app
import argparse
import os
import libpebble
import time
@computermacgyver
computermacgyver / bubblify.php
Last active March 7, 2016 21:14
PHP code to make a bubble plot SVG file
<?php
/*
Read in CSV of label, value
Need two commandline arguments: csv and svg files. e.g.,
php bubblify.php somefile.csv output.svg
Write SVG for circles of each value
Circle area varies with value from csv
Future:
@computermacgyver
computermacgyver / bubblify.py
Created March 7, 2016 21:38
Bubble plot in python (saves to SVG)
"""
Read in CSV of label, value
Need two commandline arguments: csv and svg files. e.g.
python bubblify.py somefile.csv output.svg
Write SVG for circles of each value
Circle area varies with value from csv
Future:
No text labels currently
@computermacgyver
computermacgyver / youtube_searcher.py
Created March 14, 2019 11:42
Search a YouTube channel for videos within a specific date range.
#!/usr/bin/python3
#Need
# https://github.com/googleapis/oauth2client
# https://github.com/googleapis/google-api-python-client
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.tools import argparser