Skip to content

Instantly share code, notes, and snippets.

View bilbof's full-sized avatar
😃
👍

Bill Franklin bilbof

😃
👍
View GitHub Profile
@bilbof
bilbof / dedupe.rb
Created October 22, 2019 14:27
De-duplicate queries w/counts
require 'csv'
require 'json'
# Needs an in.csv with query and count columns.
def normalise_query(query)
query.downcase.gsub('+', ' ').strip # .split(' ').sort.join(' ')
end
data = File.open('in.csv').read
# this script fetches the content items for finders (search UIs) on GOV.UK
require 'httparty'
def request(url)
JSON.parse(HTTParty.get(url).body)
end
def finders_urls
finders = request('https://www.gov.uk/api/search.json?filter_content_store_document_type=finder&count=100&fields=link').dig('results')
finders.map { |finder| finder['link'] }
@bilbof
bilbof / dhcp.sh
Created March 17, 2016 12:45
Fixing DCHP lease connection
while :
do
echo "add State:/Network/Interface/en0/RefreshConfiguration temporary" | sudo scutil
echo "refresh"
sleep 5
done

Keybase proof

I hereby claim:

  • I am bilbof on github.
  • I am billfranklin (https://keybase.io/billfranklin) on keybase.
  • I have a public key whose fingerprint is 043E E74B 05E6 AF25 D6C7 692E 1CC3 9911 7A8E 87F3

To claim this, I am signing this object: