Skip to content

Instantly share code, notes, and snippets.

Peter Rukavina reinvented

Block or report user

Report or block reinvented

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@reinvented
reinvented / charging-stations-pei.geojson
Last active May 13, 2019
Electric Vehicle Charging Stations on Prince Edward Island as of May 13, 2019 (from https://developer.nrel.gov/)
View charging-stations-pei.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@reinvented
reinvented / harvest-hansard.py
Created Dec 7, 2018
Python script to harvest Prince Edward Island Legislative Assembly Hansard PDFs and convert them to ASCII text files
View harvest-hansard.py
#!/usr/bin/env python
# You may need to do these:
#
# sudo pip install lxml
# sudo pip install requests
# sudo pip install pdfminer
from lxml import html
import requests
@reinvented
reinvented / hansard-to-csv.php
Created Dec 7, 2018
A PHP script to convert text files of Prince Edward Island Hansard to a CSV
View hansard-to-csv.php
<?php
$files = popen('find ./documents -name "*.txt"', 'r');
$out = fopen('hansard.csv', 'w');
fwrite($out, "date,text,speaker\n");
while (!feof($files)) {
$filename = chop(fgets($files, 4096));
$date = basename($filename);
@reinvented
reinvented / ruklinks.json
Last active Jul 9, 2018
Links between blog posts on ruk.ca
View ruklinks.json
@reinvented
reinvented / blog-posts-by-week.sh
Last active Jun 23, 2018
Count the number of blog posts per week in Ton's blog
View blog-posts-by-week.sh
export LC_ALL=C
curl -s https://www.zylstra.org/blog/feed/ | \
grep pubDate | \
sed -e 's/<pubDate>//g' | \
sed -e 's/<\/pubDate>//g' | \
while read -r line ; do
date -j -f "%a, %d %b %Y %T %z" "$line" "+%V"
done | \
sort -n | \
uniq -c
@reinvented
reinvented / calculate-payroll.scpt
Created Feb 26, 2017
JXA Scripting of Numbers.app, using AJAX to calculate payroll deductions from a remote PHP script
View calculate-payroll.scpt
Numbers = Application('Numbers');
Numbers.includeStandardAdditions = true
var table = Numbers.documents[0].sheets[0].tables[0]
var selectedRow = table.selectionRange().cells[0];
var hoursCellRow = selectedRow.row().address();
var weekEndingCell = table.ranges["B" + hoursCellRow + ":B" + hoursCellRow].cells[0];
var nameCell = table.ranges["C" + hoursCellRow + ":C" + hoursCellRow].cells[0];
@reinvented
reinvented / camino-with-waypoints.geojson
Last active Feb 15, 2017
Camino Frances walking route with overnight waypoints
View camino-with-waypoints.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@reinvented
reinvented / caminofrances.geojson
Last active Feb 14, 2017
Route map of a walk of the Camino Frances
View caminofrances.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@reinvented
reinvented / caminofrances1.geojson
Last active Feb 10, 2017
St Jean to Larrosaona of the Camino Frances
View caminofrances1.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@reinvented
reinvented / pdoc.php
Last active Jun 12, 2019
Automating the use of Canada Revenue's Payroll Deductions Online Calculator in PHP
View pdoc.php
<?php
/**
* get-pdoc.php - Scrape Canada Revenue Agency payroll deductions values
*
* This script takes an hourly amount, a number of hours, and a year,
* month and day of a pay period ending, and passes these to the
* Canada Revenue Agency Payroll Deductions Online Calculator
* (https://www.canada.ca/en/revenue-agency/services/e-services/e-services-businesses/payroll-deductions-online-calculator.html),
* returning the provincial tax, federal tax, CPP and EI amounts.
*
You can’t perform that action at this time.