Skip to content

Instantly share code, notes, and snippets.

View brycemcd's full-sized avatar

Bryce McDonnell brycemcd

View GitHub Profile
@brycemcd
brycemcd / troubleshooting-wifi-notes.md
Last active April 15, 2019 20:53
Wifi analysis using wireshark on Ubuntu 18.10
@brycemcd
brycemcd / five_tips_for_thinking_in_clojure.md
Last active February 1, 2020 23:32
Five Tips For Thinking in Clojure

5 Tips for Thinking in Clojure

Sent by the Pragmatic Programmers, LLC. • 9650 Strickland Rd Ste 103-255• Raleigh NC 27615 - Feb. 21st, 2018

  1. Rely on your REPL. Clojure (like other LISP languages) intends to provide a "live" development experience where you are actively manipulating and testing the program while you develop the code. To take full advantage of Clojure, it's essential to work in a development environment that allows you to interactively evaluate parts of your code while you develop. We are fortunate to have a variety of tool choices in Clojure that can satisfy those demands.
  2. Maps, not Objects. Developers coming from object-oriented languages are likely to look for the ability to create classes or objects to hold their data. Clojure takes a more direct and flexible approach to data, primarily storing information attributes in heterogenous maps. Rather than providing class-specific interfaces, Clojure provides a single generic data interface for creating, accessing, and transforming att
@brycemcd
brycemcd / ansible_cheatsheet.md
Last active September 27, 2018 02:43
A smattering of frequently used commands I use. This will help prevent excessive load on Google's systems.

Ansible Cheatsheet

A smattering of frequently used commands I use. This will help prevent excessive load on Google's systems.

NOTE: most examples are copied and pasted from the documentation. Attribution belongs to the contributors of the documentation!

Template

http://docs.ansible.com/ansible/latest/template_module.html

@brycemcd
brycemcd / db.clj
Created June 1, 2017 12:22
database connect in clojure
(ns learn-lein.core
(:require [clojure.java.jdbc :as db]
[jdbc.pool.c3p0 :as pool]))
(def my-db {:subprotocol "postgresql"
:subname "//spark3.thedevranch.net:5432/fitbit_heartrate"})
(def my-pool (pool/make-datasource-spec my-db))
(def heartrates (db/query my-pool ["SELECT * FROM activity_journal_minutes LIMIT 10"]))
@brycemcd
brycemcd / openzoom.zsh
Created December 14, 2016 15:34
Opens a zoom meeting in a browser from the command line
#!/bin/zsh
# Opens a zoom meeting with the name you've given it.
# Drop this script in /usr/local/bin/openzoom
# Invoke with `openzoom meeting_name`
typeset -A meeting
# NOTE: set this hashmap with meeting_name and ids of that meeting
meeting[meeting_name]=123456789
@brycemcd
brycemcd / projects.md
Last active August 29, 2017 02:28
A brief listing of hobby projects I am attempting or would like to attempt

Hobby Projects

This serves as a repository of ideas that have popped into my head. As I have time, I play around with one.

  1. Mute Button - Automatically mute television commercials using machine learning and Spark
  2. NYC Taxi - A cabbie once told me that the length of each trip he takes is much longer than it was before. Use math to prove/disprove it. This data needs a lot of cleanup and profiling before it can be properly analyzed. NYC Taxi Data Cleanup Project
  3. Heart Rate Anomaly Detector - Automatically detect afib in the fitbit HR
  4. Picam Fun - Detect movements and objects from images work started here
  5. Listicle - Organize online articles for reading frontend [backend](https://github.com/brycemcd/email-l
@brycemcd
brycemcd / epsilon-Greedy_sanity_check.R
Created December 30, 2015 04:13
Reads in the output file of a monte carlo simulation for an epsilon-Greedy bandit algorithm implementation
library("dplyr")
library("tidyr")
library("ggplot2")
epsilonGreedySanityCheck <- read.csv("~/Desktop/epsilonGreedySanityCheck.txt", header=FALSE)
names(epsilonGreedySanityCheck) <- c("testRun",
"iterationNum",
"epsilon",
"nArms",
"exploreOrExploit",
@brycemcd
brycemcd / citibik_avro_readable.sh
Created November 29, 2015 19:18
Creating Avro schema for Citibike Data
#!/bin/bash
# NOTE: this is the readable version. Escape quotes and remove new lines prior to submitting
curl -X POST -H 'Content-Type: application/vnd.schemaregistry.v1+json' -d '{
"type": "record",
"name": "citibike",
"fields" : [
{ "name": "executionTime", "type": "string"},
{ "name": "stationBeanList", "type": {
"type" : "array",
@brycemcd
brycemcd / moves_to_activities.sh
Last active August 26, 2015 01:48
extract moves api data into a csv
jq -r '.[0].segments | .[] | select(.type == "move") | .activities[] | {act: .group, startTime: .startTime, endTime: .endTime, duration: .duration, distance_in_meters: .distance} | map(.) | @csv' 20150825.json | less
@brycemcd
brycemcd / bucketed_elasticsearch_query.json
Created August 17, 2015 21:03
retrieve a set of basic statistics about my accept/reject rate of links sent to me in email
GET /email_links/email_link/_search
{
"size": 0,
"aggs": {
"decision_count": {
"terms": {
"field": "accepted"
}
},
"total_articles_over_time": {