Skip to content

Instantly share code, notes, and snippets.

View mpalmerlee's full-sized avatar

Matt Palmerlee mpalmerlee

View GitHub Profile
@dinvlad
dinvlad / retries.ts
Last active February 2, 2024 16:18
Retries with exponential backoff and jitter for idempotent background Google Cloud Functions
// one can also use Google Cloud Firestore library,
// with a slight change in semantics
import { firestore } from 'firebase-admin';
import { EventContext, runWith } from 'firebase-functions';
import { promisify } from 'util';
const eventCollection = 'function-events';
enum EventStatus {
RUNNING = 'running',
@konstantinbo
konstantinbo / custom-loki.sh
Last active September 13, 2022 13:14 — forked from evertontrindade/custom-loki.sh
Things to do after install Elementary OS Loki (0.4)
# First you update your system
sudo apt update && sudo apt-get dist-upgrade
# Clean-up System
sudo apt purge epiphany-browser epiphany-browser-data #browser
sudo apt purge midori-granite #browser
# sudo apt-get purge noise # music player
sudo apt autoremove
sudo apt autoclean
@jakiestfu
jakiestfu / git_rdiff.sh
Last active January 4, 2024 20:42
git rdiff
git config --global alias.rdiff '!g() { origin=$(git config --get remote.origin.url | sed "s/git@/https:\/\//g" | sed "s/.com:/.com\//g"); url=${origin/.git/\/commit\/$(git rev-parse HEAD)}; open $url; }; g'
@jakiestfu
jakiestfu / rdiff.sh
Last active August 29, 2015 13:57
Git Remote Diff: Open the latest commit diff in GitHub
git config --global alias.rdiff '!g() { origin=`git config --get remote.origin.url`; origin=${origin/git@github.com:/https://github.com/}; url=${origin/.git/\/commit\/`git rev-parse HEAD`}; open $url; }; g'
@subelsky
subelsky / casperjs_example.js
Created August 8, 2012 18:51
Webscraping with CasperJS, PhantomJS, jQuery, and XPath
var system = require('system');
if (system.args.length < 5) {
console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code.");
phantom.exit();
}
var account = system.args[1];
var username = system.args[2];
var password = system.args[3];