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 / BC webapp admin UI schema.js
Created July 13, 2017 06:04
BC webapp admin UI schema
const ordering = ['fieldID', 'type', 'mandatory', 'dataSourceID', 'useWYSIWYG', 'unknownProperty']
const fieldTypes = {
'1': 'Text (string)',
'3': 'Boolean',
'5': 'List (Dropdown List)',
'8': 'Media',
'6': 'List (Checkbox List)',
'9': 'Text (Multiline)',
'11': 'Hyperlink',
@r-k-b
r-k-b / dump-liquid-scope-to-console.html
Last active July 20, 2017 05:58
A quick way to inspect the contents of the Global Scope in Liquid Markup, using the browser's dev tools.
<script type='text/javascript' data-source='https://gist.github.com/r-k-b/6617f49ec6922050802471ff229f7e86'>
// # dump-liquid-scope-to-console
//
// A quick way to inspect the contents of the Global Scope in Liquid Markup, using the browser's dev tools.
(function () {
function decodeHtml(html) {
var txt = document.createElement("textarea");
txt.innerHTML = html;
return txt.value;
@r-k-b
r-k-b / .csscomb.json
Last active May 2, 2017 05:11
Preferred CSS styling
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "single",
@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 <[email protected]>
// @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
@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 / power-query-iso-week-year.md
Last active October 21, 2025 18:39 — 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"`)
# 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 / 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)
@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 / 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()