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 / AddThis tracking with GTM.md
Created November 2, 2016 04:55 — forked from robkb/AddThis tracking with GTM.md
AddThis tracking with GTM
@r-k-b
r-k-b / _bc-theme-switcher.md
Last active March 6, 2017 05:22
Simple, powerful dynamic theme switcher for Business Catalyst.

Ignore the .twig extensions, that's just for the code highlighting. These files are just html + BC-flavoured Liquid Markup.

This code is currently built to switch themes based on time. Only minor changes would allow changing themes by other factors, such as which domain the page is being served from.

template-boilerplate

This snippet must go at the top of each Page Template. Although it must be repeated in each, it should be far less likely to change than the information in theme-data.json.

@r-k-b
r-k-b / _data-relationship-visualisations.md
Last active September 19, 2017 07:00
data relationship visualisations
@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 {
@r-k-b
r-k-b / pass-current-time-to-update.elm
Created February 13, 2017 11:17
How do I get the current time in Elm 0.18?
{-|
Based on [robertjlooby's answer](http://stackoverflow.com/a/38022835/2014893), updated for Elm 0.18.
-}
import Html exposing (div, button, text, program)
import Html.Events exposing (onClick)
import Task
import Time exposing (Time)
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@r-k-b
r-k-b / power-query-iso-week-year.md
Last active February 8, 2024 21:44 — forked from robkb/power-query-iso-week-year.md
M functions to convert between ISO 8601 Week & Year ⇄ dates (e.g., `2014-12-29` ⇄ `"2015-W01-1"`)
@r-k-b
r-k-b / ligatures-for-sanctuary.user.js
Last active March 20, 2017 01:44
Allow Ligatures in more places in Sanctuary.js's docs. Intended for use alongside a custom CSS theme that applies a font like Fira Code.
// ==UserScript==
// @name Ligatures for Sanctuary.js Docs
// @namespace https://gist.github.com/r-k-b/
// @version 0.1
// @description Allow Ligatures in more places in Sanctuary.js's docs. Intended for use alongside a custom CSS theme that applies a font like Fira Code.
// @author Robert K. Bell
// @homepage https://gist.github.com/r-k-b/dd02d4e641826a721dec112d40b90630
// @downloadURL https://gist.github.com/r-k-b/dd02d4e641826a721dec112d40b90630/raw/ligatures-for-sanctuary.user.js
// @match https://sanctuary.js.org/*
// @grant none
@r-k-b
r-k-b / no-alerts-when-changing-bc-page-templates.user.js
Last active April 11, 2017 04:33
No Alerts When Changing Page Templates
// ==UserScript==
// @name No Alerts When Changing Page Templates
// @namespace https://gist.github.com/r-k-b
// @version 1.1.0
// @description No Alerts When Changing Page Templates
// @author Robert K. Bell <robert.k.bell@gmail.com>
// @homepage https://gist.github.com/r-k-b/9675b4e353f59e968d1986bc6f7ac2a0
// @downloadURL https://gist.github.com/r-k-b/9675b4e353f59e968d1986bc6f7ac2a0/raw/no-alerts-when-changing-bc-page-templates.user.js
// @match https://*.worldsecuresystems.com/Admin/WebPages_Detail.aspx?PageID=*
// @grant none