Skip to content

Instantly share code, notes, and snippets.

View r-k-b's full-sized avatar

Robert K. Bell r-k-b

View GitHub Profile
@r-k-b
r-k-b / show-bc-field-name-in-admin.user.js
Last active June 23, 2016 03:00
show BC field name in Admin UI
// ==UserScript==
// @name Show BC form field name in Admin
// @namespace https://gist.github.com/r-k-b/
// @version 1.0.0
// @description Show BC form field name in Admin UI
// @author Robert K. Bell
// @homepage https://gist.github.com/r-k-b/329d1fb5cbf4de0f7d3f322a5ecc1cbe
// @downloadURL https://gist.github.com/r-k-b/329d1fb5cbf4de0f7d3f322a5ecc1cbe/raw/show-bc-field-name-in-admin.user.js
// @match https://*.worldsecuresystems.com/*
// @grant none
@r-k-b
r-k-b / link-direct-to-pp-newsletter.user.js
Last active August 11, 2016 09:30
Link directly from the EDM template chooser in a BC admin console, to the template editor in the Partner Portal.
@r-k-b
r-k-b / typescript-doesn't-like-array-destructuring-to-args.ts
Created October 3, 2016 07:34
Array destructuring into args doesn't seem to play nice with Typescript
// ramda 0.22.1
// typescript 2.0.3
import {pipe, add, multiply, identity} from 'ramda';
// both f1 & f2 are valid JS, but typescript doesn't like f1...
// `Error:(13, 10) TS2346:Supplied parameters do not match any signature of call target.`
let x = 3;
@r-k-b
r-k-b / keybase.md
Created October 18, 2016 09:14
Identity claim.

Keybase proof

I hereby claim:

  • I am r-k-b on github.
  • I am robkb (https://keybase.io/robkb) on keybase.
  • I have a public key whose fingerprint is 219F AA0B B5CE 3286 5F51 4FCF 7094 56F8 1B22 4646

To claim this, I am signing this object:

@r-k-b
r-k-b / get-month-boundary-pairs-as-ISO8601.m
Last active October 19, 2016 04:44
Get a list of the start and end dates of the current and the previous month, as ISO 8601 formatted dates. (Power Query)
// Get a list of the start and end dates of the relative month, as ISO 8601 formatted dates.
//
// E.g.:
// ```
// {
// "2016-09-01",
// "2016-09-31"
// }
// ```
//
@r-k-b
r-k-b / extract-blogs-from-sharepoint.js
Last active October 25, 2016 08:27
Extract blog data from Sharepoint
(function(){
var mutateResults = [];
var urlPrefix = 'https://wnswlhd.health.nsw.gov.au/In-the-media';
function transform(result) {
return {
id: result.ID,
title: result.Title,
url: `${urlPrefix}/Lists/Posts/Post.aspx?ID=${result.ID}`,
@r-k-b
r-k-b / yearMonth-index-table.powerquery
Created October 25, 2016 21:51
Generate a table of yearMonth info & names. Handy for Power BI + Google Analytics.
let
yearsList = {2012..2099},
months = {1..12},
CalcMonthOffset = (dateA as date, dateB as date) as number => let
ordA = Date.Year(dateA) * 12 + Date.Month(dateA),
ordB = Date.Year(dateB) * 12 + Date.Month(dateB),
result = ordA - ordB
in
@r-k-b
r-k-b / how-many-links-will-work-with-GA-ELA.js
Created October 27, 2016 22:26
How many links on the page will work with Enhanced Link Attribution in Google Analytics?
@r-k-b
r-k-b / bc-menu-depth-limit-testing.js
Created January 25, 2017 04:07
Add as many nested children to a BC menu as possible.
// Run from the 'Menu' Admin UI pages, like https://foo.worldsecuresystems.com/Admin/Menus_Detail.aspx?MenuID=1234356&A=Items
(() => {
let n = 228;
function addItem(name) {
let $label = $('#ctl00_cp_uc_name');
let $selectParent = $('#ctl00_cp_uc_parentId');
let lastAncestorID = $selectParent.children('option').last().val()
@r-k-b
r-k-b / trello-for-tv.css
Created February 2, 2017 21:56
Tweak Trello for better card title visibility when chromecast'd to TVs
/* Tweak Trello for better card title visibility when chromecast'd to TVs. */
/* https://gist.github.com/r-k-b/5b65b6172ccea201db3183da9b712419 */
#board {
margin-bottom: 0;
padding-bottom: 0;
}
#header {