Skip to content

Instantly share code, notes, and snippets.

View pjivers's full-sized avatar

Patrick Ivers pjivers

  • Melbourne, Australia
View GitHub Profile
@pjivers
pjivers / coinspot-dashboard-profitloss.js
Last active February 14, 2021 05:34
Adds a Profit/Loss panel to the CoinSpot dashboard
// ==UserScript==
// @name CoinSpot Dashboard Profit/Loss
// @version 0.8
// @author Patrick Ivers
// @match https://www.coinspot.com.au/my/dashboard
// @grant none
// ==/UserScript==
/* eslint-disable no-multi-spaces */
(function() {

Keybase proof

I hereby claim:

  • I am pjivers on github.
  • I am pjivers (https://keybase.io/pjivers) on keybase.
  • I have a public key ASBYHleLwrxccnBtAsx_zBWMDqebg-2iW1m7n0FiOzYcXQo

To claim this, I am signing this object:

@pjivers
pjivers / remove-early-birds.js
Last active May 6, 2020 10:13
Removes premium "Early bird" listings from search results on flatmates.com.au
// ==UserScript==
// @name Remove Early Birds
// @description Removes premium "Early bird" listings from search results
// @version 1
// @author Patrick Ivers
// @match https://flatmates.com.au/*
// @grant none
// ==/UserScript==
function removeEarlyBirdListings() {
@pjivers
pjivers / sha1.gs
Last active January 22, 2019 05:31
SHA1 (Google Script Editor)
/**
* Generates a SHA1 hash of a given value.
*
* @param {string} value The value to hash
* @param {number} limit An optional limit on the length of the hash
* @return {string} The hash
*/
function SHA1(value, limit) {
var rawHash = Utilities.computeDigest(Utilities.DigestAlgorithm.SHA_1, value);
var hash = '';
@pjivers
pjivers / shopify-handle-generator
Last active October 10, 2022 05:19
Shopify Handle Generator (Google Sheets)
=CONCATENATE(LEFT(REGEXREPLACE(lower(B2), "[\W_]", "-"), 30),"-",SHA1(B2, 5))
export ZSH=/Users/patrick/.oh-my-zsh
# Proxies
export ALL_PROXY=http://localhost:1234
export http_proxy=http://localhost:1234
export https_proxy=http://localhost:1234
export no_proxy="*.local, 169.254/16, localhost, 127.0.0.1, 10.0.0.0/8"
# Java
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home
@pjivers
pjivers / font-project-structure
Last active October 10, 2022 05:19
Structure of a font project
/<font_name>
/dist
<font_name>.eot
<font_name>.otf
<font_name>.svg
<font_name>.ttf
<font_name>.woff
<font_name>.woff2
/example # Examples of glyphs and usage (displayed in README.md)
glyphs.png
@pjivers
pjivers / create-project.sh
Last active August 31, 2017 05:46
A simple bash script for setting up an MIT-licensed git project
#!/bin/bash
#
# A simple bash script for setting up an MIT-licensed git project.
#
# Usage:
# sh create-project.sh <project_name>
#
echo "Creating project $1..."
mkdir $1
@pjivers
pjivers / map-params-to-url.js
Last active April 11, 2018 02:04
Maps a hash of parameter values to a URL.
/**
* Maps a hash of parameter values to a URL.
*
* @param {string} urlTemplate - URL template where parameter keys are preceded
* by a colon, e.g. "/users/:userId/posts/:postId"
* @param {object} params - Hash of parameter values. Keys must match those
* in the URL template (excluding colons).
* @throws Will throw an error if `params` does not contain values for all
* parameters defined in the URL template.
* @returns The URL with mapped parameter values.
@pjivers
pjivers / Preferences.sublime-settings
Last active February 12, 2017 03:40
User preferences for SublimeText 3
{
"color_scheme": "Packages/User/SublimeLinter/HalfLife (SL).tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 11,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 1,
"line_padding_top": 1,