Skip to content

Instantly share code, notes, and snippets.

View tlemburg's full-sized avatar

Tyler Lemburg tlemburg

View GitHub Profile
This application does not collect or store personal data.
If you installed this application from Google Play, then Google Play does collect some personal data. Please see the privacy policy for Google Play Services here: https://policies.google.com/privacy
@tlemburg
tlemburg / country_phone_codes_wikipedia.rb
Created November 12, 2020 20:29
Grab country phone codes out of Wikipedia article
require 'nokogiri'
require 'open-uri'
require 'yaml'
doc = Nokogiri::HTML.parse(open("https://en.wikipedia.org/wiki/List_of_country_calling_codes"))
table = doc.css('table.wikitable').first
cells = table.css('td')
@tlemburg
tlemburg / webhook_receiver.rb
Created October 2, 2020 18:49
Cognito webhook receiver v2
require 'sinatra'
require 'json'
require 'openssl'
require 'base64'
WEBHOOK_KEY = 'webhook_sandbox_key_19a08a7f7f181eadc45a188f815aa4f0'
WEBHOOK_SECRET = '43e042f238733fc892d9bbb06b564a023999d116a7d345c51c48611ba81e4ba4'
get '/' do
'hello world'
@tlemburg
tlemburg / app.rb
Created September 18, 2020 19:04
Sample Cognito webhook receiver
require 'sinatra'
require 'json'
require 'openssl'
require 'base64'
ENDPOINT_SECRET = 'fe1eb40c8e8d2164ffff0316a40e5f237f2e2742877e6c47a969643411547f74'
post '/webhook' do
puts ""
puts 'Webhook received!'
def flatten(array)
new_arr = []
array.each do |item|
if item.is_a?(Array)
flatten(item).each do |inner|
new_arr << inner
end
else
new_arr << item
end
[{"name":"Jobs","children":[{"name":"Management occupations","children":[{"name":"Top executives","children":[{"name":"Chief executives"},{"name":"General & operations managers"},{"name":"Legislators"}],"_collapsed":true},{"name":"Advertising, marketing, etc","children":[{"name":"Advertising & promotions managers"},{"name":"Marketing & sales managers","children":[{"name":"Marketing managers"},{"name":"Sales managers"}],"_collapsed":true},{"name":"Public relations & fundraising managers"}],"_collapsed":true},{"name":"Operations specialties managers","children":[{"name":"Administrative services managers"},{"name":"Computer & information systems managers"},{"name":"Financial managers"},{"name":"Industrial production managers"},{"name":"Purchasing managers"},{"name":"Transportation, storage, etc"},{"name":"Compensation & benefits managers"},{"name":"Human resources managers"},{"name":"Training & development managers"}],"_collapsed":true},{"name":"Other management occupations","children":[{"name":"Farmers, rancher
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
title,Hierarchy,Occupation.type,Employment.2016,Employment.2026,ChgEmploy.2016to26.Num,ChgEmploy.2016to26.Perc,Percent.self.employed..2016,Occupational.openings..2016.26.annual.average,Median.annual.wage..2017.1.,Typical.education.needed.for.entry,Work.experience.in.a.related.occupation,Typical.on.the.job.training.needed.to.attain.competency.in.the.occupation,Level0,Level1,Level2,Level3,Level4,pathString,jobcol,percentchg.indx,percentchg.col
"Total, all",0,Summary,"156,063.80","167,582.30","11,518.60",7.4,6.1,"18,742.00","$37,690 ",NA,NA,NA,Jobs,NA,NA,NA,NA,Jobs,white,11,#FF9200
Architecture & engineering,1,Summary,"2,601.00","2,795.40",194.3,7.5,2.7,210.1,"$79,180 ",NA,NA,NA,Jobs,Architecture & engineering,NA,NA,NA,Jobs/Architecture & engineering,#984EA3,11,#FF9200
"Architects, surveyors, etc",2,Summary,210.9,225.3,14.5,6.9,15.3,16.7,"$72,020 ",NA,NA,NA,Jobs,Architecture & engineering,"Architects, surveyors, etc",NA,NA,"Jobs/Architecture & engineering/Architects, surveyors, etc",#984EA3,11,#FF9200
"Architect
@tlemburg
tlemburg / bls_data.json
Last active August 20, 2019 00:20
BLS Data JSON
[{"name": "Jobs", "_collapsed":"true", "children": [{"name": "Architecture & engineering", "_collapsed":"true", "children": [{"name": "Engineers", "children": [{"name": "Civil engineers"}, {"name": "Computer hardware engineers"}, {"name": "Electrical & electronics engineers", "children": [{"name": "Electrical engineers"}, {"name": "Electronics engineers, except computer"}]}, {"name": "Engineers, all other"}, {"name": "Industrial engineers, including health & safety", "children": [{"name": "Health & safety engineers, except mining safety engineers & inspectors"}, {"name": "Industrial engineers"}]}, {"name": "Chemical engineers"}, {"name": "Petroleum engineers"}, {"name": "Marine engineers & naval architects"}, {"name": "Mining & geological engineers, including mining safety engineers"}, {"name": "Biomedical engineers"}, {"name": "Materials engineers"}, {"name": "Nuclear engineers"}, {"name": "Agricultural engineers"}, {"name": "Environmental engineers"}, {"name": "Aerospace engineers"}, {"name": "Mechanical

Installation

This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode).

PHP 5.6 installed with Homebrew.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

// ==UserScript==
// @name Trello Card Numbers
// @namespace http://
// @version 0.1
// @description Shows card numbers on trello. New cards don't get this usually so you may need to refresh the page.
// @author Tyler Lemburg
// @match https://trello.com/*
// @grant none
// ==/UserScript==