Skip to content

Instantly share code, notes, and snippets.

View tdhopper's full-sized avatar
©️
𝔀𝓸𝓻𝓴𝓲𝓷𝓰 𝓱𝓪𝓻𝓭

Tim Hopper tdhopper

©️
𝔀𝓸𝓻𝓴𝓲𝓷𝓰 𝓱𝓪𝓻𝓭
View GitHub Profile
@tdhopper
tdhopper / storm_worker_uptime.py
Created October 2, 2014 19:04
Hacky way to get a table showing uptime for all Storm workers
import pandas as pd
import requests
username = 'STORM-UI-USERNAME'
password = 'STORM-UI-PASSWORD'
base_url = 'STORM-UI-URL'
cluster_summary = '/api/v1/cluster/summary'
topology_summary = '/api/v1/topology/summary'
topology_detail = '/api/v1/topology/{topology}'
component = '/api/v1/topology/{topology}/component/{component}'
@tdhopper
tdhopper / smooth_weight.R
Created August 30, 2014 13:56
Smooth Weight from Text File Created by IFTTT
INPUT_PATH <- "~/Dropbox/Text Notes/Weight.txt"
OUTPUT_PATH <- "~/Dropbox/Text Notes/Weight Stats.txt"
library(lubridate)
library(ggplot2)
library(zoo)
# READ FILE
con <- file(INPUT_PATH, "rt")
lines <- readLines(con)
path.conf: "/Users/tdhopper/es-config"
path.logs: "/Users/tdhopper/es-logs"
index.indexing.slowlog.threshold.index.warn: 10s
index.indexing.slowlog.threshold.index.info: 0s
index.indexing.slowlog.threshold.index.debug: 0s
index.indexing.slowlog.threshold.index.trace: 0s
[
{
"_score": 1.0,
"_type": "url",
"_id": "epicurious.com-http://www.epicurious.com/recipes/food/views/Balsamic-Strawberries-with-Whipped-Mascarpone-Cheese-105321-1hour-2014.08.06.18",
"_source": {
"metrics": {
"other/returning/entrance_view": 1,
"other/$all/page_view": 2,
"$any/returning/entrance_view": 1,
tdhopper@~/repos/parsely/ptrack/streamparse (streamparse-dev) [feature/visitor-metrics] $ streamparse stats -e 0.9 -n index
# Topology summary
+-------+----------------------+--------+------------+--------------+----------------+------------+
| name | id | status | uptime | workersTotal | executorsTotal | tasksTotal |
+-------+----------------------+--------+------------+--------------+----------------+------------+
| index | index-367-1407431678 | ACTIVE | 2h 30m 12s | 8 | 85 | 85 |
+-------+----------------------+--------+------------+--------------+----------------+------------+
# Spouts (All time)
+-----------------------+---------+-------------+-----------------+--------+--------+
| spoutId | emitted | transferred | completeLatency | acked | failed |

Cornelius Lanczosm, H. Eves Mathematical Circles Squared

Most of the arts, as painting, sculpture, and music, have emotional appeal to the general public. This is because these arts can be experienced by some one or more of our senses. Such is not true of the art of mathematics; this art can be appreciated only by mathematicians, and to become a mathematician requires a long period of intensive training. The community of mathematicians is similar to an imaginary community of musical composers whose only satisfaction is obtained by the interchange among themselves of the musical scores they compose.

from warnings import warn
from collections import Counter
from streamparse.bolt import Bolt
class WordCounter(Bolt):
def initialize(self, conf, ctx):
self.counts = Counter()
@tdhopper
tdhopper / Directions.md
Last active May 15, 2017 15:14
A totally unrefined technique for sending a moving average of my weight to my phone.

Weight measurement is noisy. It can be discouraging to see your weight fluctuate even if those fluctuations are meaningless. I taped over the weight display on my Withings scale and hacked together this method of getting smoothed statistics (moving average) of my weight.

This this requires:

@tdhopper
tdhopper / screenshot.md
Last active September 13, 2024 15:05
Using Keyboard Maestro to paste text from your clipboard to Drafts on iOS via Pushover. The Keyboard Maestro action will send a link to Pushover that will open the text in Drafts. The amount of text you can send is limited by the Pushover API.