Skip to content

Instantly share code, notes, and snippets.


Pete LePage petele

View GitHub Profile
View watch-pages.json
"url": "CoO:!/",
"proxy": true,
"priority": 1,
"description": "DOB Now - Current Certificate of Occupancy",
"skip": true,
"terms": [
"term": "\"IsSuccess\":true,",
petele / .aliases
Created October 4, 2017 14:32
My dotfiles
View .aliases
# Make ls in color
alias ls="command ls -G"
petele / PromiseResolveAll.js
Last active June 13, 2017 20:53
View PromiseResolveAll.js
Promise.resolveAll = function petepete(promises) {
function reflect(promise) {
if (Promise.resolve(promise) !== promise) {
return promise;
return promise.then((v) => {return v;}).catch((e) => {return e;});
return Promise.all(;
petele / uber.js
Last active March 9, 2018 17:29
Calculates the number of rides and amount you've spent with Uber.
View uber.js
// To use: Visit, open the Chrome DevTools and
// paste this script into the console, then click the > (next page) icon on the
// bottom of the page, and once the page has finished loading, run `calcPage()`
// again to add that page to your total. Keep going until you've finished all of
// the pages.
// Note: this script doesn't handle different currencies, everything will be
// treated as the same currency.
var total = 0.0;
var count = 0.0;
petele / seamless.js
Last active February 2, 2022 18:53
Want to know how much money you've spent on Seamless in your lifetime? Pop over to your Order History page (, scroll all the way to the bottom so it stops loading any more results, then open the Console in the Chrome DevTools and paste this chunk of code in. Voila! The number of orders you've…
View seamless.js
// This probably doesn't work anymore.
let lines = "";
var orders = $("tbody#OrderHistoryLikedItem tr");
var count = 0;
var amount = 0.0;
for (var i = 0; i < orders.length; i++) {
try {
var tr = $(orders[i]);
var d = tr.find(" strong")[0].innerText.trim();
var v = tr.find("td.vendor a")[0].innerText.trim();