Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env -s rails runner
UTILITIES = (<<~NAMES).split("\n").map(&:upcase)
American Petroleum Institute%
National Grid%
Consolidated Edison%
NRG Energy%
NRG New York%
NRG NY%
Astoria Generating Company%
%Court Officers%
%CORRECTION OFFICERS%
%Police Officers%
%Officers Association%
%Detectives Association%
%SHERIFF%ASSOCIATION%
%Patrolmen%
%POLICE%
PBA%
Correction Officers Benevolent Association%
<Provider>
<Root>
<GraphHeader>
<GraphTitleForm />
<GraphTitle />
<GraphByLine />
<GraphLinks />
</GraphHeader>
<Graph>
<svg>
@aepyornis
aepyornis / sec_filing_example.json
Created August 5, 2019 16:26
Sec::CIKS.EEP.filings.first.document.to_h
{
"metadata": {
"cik": "880285",
"company_name": "ENBRIDGE ENERGY PARTNERS LP",
"form_type": "4",
"date_filed": "2018-12-20",
"filename": "edgar/data/880285/0000899243-18-031517.txt"
},
"document": {
"ownershipDocument": {
@aepyornis
aepyornis / profile_page_relationship_categories.md
Created July 24, 2019 18:30
How Relationships are sorted for profile pages

relationship categories

People

name sort
business positions updated at
in the office of positions updated at
membersips updated at
schools updated at
@aepyornis
aepyornis / Rakefile
Created April 24, 2019 19:37
GPG encrypted journal
# frozen_string_literal: true
GPG_KEYIDS = ['YOUR_GPG_KEY_ID']
GPG_RECIPIENTS = GPG_KEYIDS.reduce(String.new) { |str, key| str << "--recipient #{key}" }
DECRYPTED_DIR = File.expand_path('./decrypted')
ENCRYPTED_TAR = File.expand_path('./encrypted.tar.gpg')
ARCHIVE_DIR = File.expand_path('./archive')
desc 'setup encrypted folder'
task :setup do
require_relative './utility.rb'
module IapdImporter
IAPD_JSON_FILE = Rails.root.join('top_200.json').to_s
Advisor = Struct.new(:data, :business) do
delegate :entity, to: :business
delegate :fetch, to: :data
def associated_entity_ids
function git-fixup! -a ref
if not git log --format="%H" -20 | grep -q $ref
# In theory we could rebase back to ANY commit.
# But I'm probably not going to want to unless it's a recent commit.
printf "Could not find $ref in the last 20 commits\n"
return 1
end
git commit --fixup=$ref
git rebase --interactive --autosquash "$ref~1"
@aepyornis
aepyornis / companies_over_10_billion.json
Created November 1, 2018 19:07
Companies in the IAPD dataset with more than $10 billion in assets
This file has been truncated, but you can view the full file.
[
{
"name": "STRATEGIC ADVISERS LLC",
"sec_file_number": "801-13243",
"crd_number": 104555,
"assets_under_management": 340408400000,
"total_number_of_accounts": 815521,
"table": "IA_ADV_Base_A_20180401_20180630",
"owners": [
{
@aepyornis
aepyornis / timeline.md
Created August 2, 2018 19:47
timeline

Timeline

August

  • all cmp data in
  • NYS data updated
  • Follow the money matching ids
  • image functionality improvements
  • various bug fixes
  • upgrade Ruby and Mariadb