Skip to content

Instantly share code, notes, and snippets.

View hrbrmstr's full-sized avatar
💤
#tired

boB Rudis hrbrmstr

💤
#tired
View GitHub Profile
@hrbrmstr
hrbrmstr / index.html
Last active April 8, 2024 12:19
Graphing Maine power outages with D3. The "meta refresh" is the sub-optimal way of updating every 5 minutes, but the fam was getting a bit irked that I was coding on Thanksgiving. See previous gists and http://rud.is/b entries for why I made this. UPDATE : 2013-12-23 : mouseover now shows historical graphs of outages; data table cleaned up and t…
<!DOCTYPE html>
<!--
-- by @hrbrmstr (2013)
-- MIT License
-->
<html>
<head>
<title>Central Maine Power Live Outage Map</title>
<meta charset="utf-8"/>
<meta http-equiv="refresh" content="300"/>
@hrbrmstr
hrbrmstr / bean-labeler.ts
Created March 16, 2024 08:56 — forked from haileyok/bean-labeler.ts
Bean Auto Labeler
import {
AppBskyEmbedImages,
AppBskyFeedPost,
BskyAgent,
} from '@atproto/api'
import * as dotenv from 'dotenv'
import {ComAtprotoSyncSubscribeRepos, subscribeRepos, SubscribeReposMessage} from 'atproto-firehose'
import Anthropic from '@anthropic-ai/sdk'
import axios from 'axios'
@hrbrmstr
hrbrmstr / kev2rss.R
Created October 30, 2022 11:09
Turn CISA's KEV JSON into a bare-bones RSS feed
#!/usr/bin/Rscript
kev <- jsonlite::fromJSON("https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json")
vulns <- kev$vulnerabilities
vulns <- vulns[nrow(vulns):1,]
rss_body <- '
<rss version="2.0">
<channel>
@hrbrmstr
hrbrmstr / README.md
Last active January 7, 2024 22:35
French towns, surnames and suffixes

The best way to grab these files is to git clone the gist or download it as a ZIP.

If I knew more about French noun constructs I would have tried to do the suffix extraction myself, but it would have probably ended up doing nothing more than proving I'm an uneducated American ;-)

fr_names.csv

These are all the "place names" in France. The first column is the UTF-8 encoding of the name. The second column is the ASCII encoding of the name. This is from geonames

You'll want to get the full geonames file as it has the long/lat of the place name center (which can be used to replicate the example).

library(data.table)
library(dplyr)
library(tidyr)
library(ggplot2)
library(scales)
library(grid)
library(statebins)
library(gridExtra)
# http://www.washingtonpost.com/wp-srv/special/investigative/asset-seizures/data/all.json
@hrbrmstr
hrbrmstr / f1000.csv
Created March 23, 2016 16:02
2015 Fortune 1000 List with industry & website
name industry sector website rank
Walmart General Merchandisers Retailing http://www.walmart.com 1
Exxon Mobil Petroleum Refining Energy http://www.exxonmobil.com 2
Chevron Petroleum Refining Energy http://www.chevron.com 3
Berkshire Hathaway Insurance: Property and Casualty (Stock) Financials http://www.berkshirehathaway.com 4
Apple Computers, Office Equipment Technology http://www.apple.com 5
General Motors Motor Vehicles and Parts Motor Vehicles & Parts http://www.gm.com 6
Phillips 66 Petroleum Refining Energy http://www.phillips66.com 7
General Electric Diversified Financials Financials http://www.ge.com 8
Ford Motor Motor Vehicles and Parts Motor Vehicles & Parts http://www.ford.com 9
@hrbrmstr
hrbrmstr / continents.json
Created January 22, 2015 01:01
Continents GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hrbrmstr
hrbrmstr / code_ex.r
Created March 6, 2016 16:31
hack-ish way to get all the code examples from your package
fil <- list.files("man", full.names=TRUE)
cat(sapply(fil, function(x) {
rd <- tools::parse_Rd(x)
ex <- rd[devtools:::rd_tags(rd) == "examples"]
trimws(paste0(devtools:::process_ex(ex, run=FALSE), sep="", collapse="\n"))
}, USE.NAMES=FALSE))
https://publicwww.com/websites/NoSuchBucket/
aws s3 mb s3://BUCKET_NAME
aws s3 cp SOMEFILE s3://BUCKET_NAME SOMEFILE
{
"Version":"2018-01-01",
"Statement":[{"Sid":"AddPerm","Effect":"Allow","Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::BUCKET_NAME/*"] }]