Skip to content

Instantly share code, notes, and snippets.

View sammich's full-sized avatar
🤓

Samuel Chan sammich

🤓
  • Sydney, Australia
View GitHub Profile
@sammich
sammich / rules.md
Last active May 3, 2018 13:20
My 1Blocker Rules

Hide Page Elements

Fix msy.com.au

Domain: www.msy.com.au

Selector: .container .row .col-md-2[style]

Ads on 9to5mac

@sammich
sammich / cv.js
Last active August 20, 2017 12:50
var items = this.context.binding.get('value').items,
html = '<table class="table table-sm table-bordered"><thead class="thead-default"><tr><th>Property</th><th>Value</th></tr></thead>';
html += items.map(function (i) {
var a;
try {
a = JSON.parse(i.value);
} catch (e) {
a = i.value;
}
@sammich
sammich / README.md
Last active June 25, 2020 16:33
A little helper script for working with Client-side Human Services

CV Inspector

This is a script/bookmarklet to be used with IBM BPM Client-side Human services.

Getting Started

You have two options: as a userscript, or as a bookmarklet. I recommend the former.

Userscript

word-fitter

This was originally a fiddle.

It's a dumb little thing I made after seeing a poster with 'fitted' text. It take a long corpus of text, and fits all that text within a certain width on screen, creating a poster/wall of text where each line perfectly fills the width of the column.

The fiddle [http://jsfiddle.net/Jx39q/1/].

@sammich
sammich / script.js
Created January 22, 2017 23:16
Find a CoachView by it's Control ID
/**
* Returns the CoachView instance object for the control ID. To limit the scope of the search,
* provide a parent DOM Element or CoachView instance as the second argument.
*
* Note: Control IDs are not unique per page - this will return only the first CoachView with the
* supplied ControlID on the page or under the given parent.
*
* @param {string} controlId - control ID search target
* @param {Element | CoachView} [parent] - limit to CoachViews under this
@sammich
sammich / anz-xacts-to-tsv.js
Last active December 28, 2016 07:56
Simple script to use on your ANZ online banking to get a tab-delimited console output to paste into a spreadsheet
console.clear();
var text = [];
String.prototype.toTitleCase = function () {
return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
};
$('.clickableTxnRow').each(function () {
var a = $(this);
@sammich
sammich / bpmdash.js
Created April 20, 2016 06:31
Sssssh...this is still a work in progress, and Sam hasn't decided if he should release it yet.
var _ = (function () {
return {
// array
filter: array_filter
, last: array_last
, map: array_map
, pop: array_pop
, push: array_push
, unshift: array_unshift
@sammich
sammich / bpmdash.js
Created April 20, 2016 06:31
Sssssh...this is still a work in progress, and Sam hasn't decided if he should release it yet.
var _ = (function () {
return {
// array
filter: array_filter
, last: array_last
, map: array_map
, pop: array_pop
, push: array_push
, unshift: array_unshift
$('.vote-positive').each(function (i, el) {
var pos = +el.textContent;
var neg = +$(el).siblings('.vote-negative').text()
var tot = pos + Math.abs(neg);
if (tot < 40) {
console.log(tot)
$(el).closest('li').css('opacity', 0.5)
}
@sammich
sammich / areadme.md
Last active August 29, 2015 14:23
Modifies the new MR Spy for...reasons

New MR Spy Modifier

First off, I love the new forums that Arn and the team have put up. Vast improvement. And I'm also thankful that the Spy wasn't a porting afterthought and left for later to be released.

But I still have some suggestions that would make the Spy better. And most, if not all, of the suggestions are implemented in the attached UserScript newspy.user.js attached here.

The mod is made as the MR Spy was at 2015-06-23 0030 (AEST).

I 'built' and tested it on Chrome via the Tampermonkey extension. There's no reason why other UserScript extensions or Firefox won't be able to handle this either.