Skip to content

Instantly share code, notes, and snippets.

@ScottMaclure
ScottMaclure / slack_draft_deleter.js
Last active May 9, 2024 14:58
Slack Draft Deleter
// Remove all drafts from your drafts view
// Navigate to drafts
// F12 to raise dev console
// Paste the below
(async function(x) {
for (let e = document.querySelector('[type="trash"]'); e != null; e = document.querySelector('[type="trash"]')) {
e.click();
await new Promise(resolve => setTimeout(resolve, 500))
document.querySelector('[data-qa="drafts_page_draft_delete_confirm"]').click();
await new Promise(resolve => setTimeout(resolve, 1500))
@ScottMaclure
ScottMaclure / git-aliases.sh
Last active April 30, 2021 02:05
Git Aliases
# Some handy aliases I use for git/terminal.
# For bash/zsh.
# "git pull all (nested)"
# maxdepth 4 is arbitrary for my needs, e.g, stuff like:
# dev root folder -> client space -> project workspace -> repo1, repo2, repo3
alias gpa='find . -type d -maxdepth 4 -name .git -exec git --git-dir={} --work-dir=$PWD/{}/../ pull \;'
<script>
import { onDestroy } from 'svelte';
import { healthcheck } from '../stores/healthcheck.js';
</script>
<h1>My Healthcheck Page</h1>
<p>Server healthcheck: <code>{JSON.stringify($healthcheck)}</code></p>
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@ScottMaclure
ScottMaclure / jquery.loadBlazeTemplates.js
Created September 24, 2014 09:22
jQuery loadBlazeTemplates
/**
* Load remote template code via XHR
* Then create Blaze Template from it.
* Will result in Template[templateName] being defined.
*/
function loadBlazeTemplates(options) {
var d = $.Deferred();
var loadTotal = Object.keys(options).length;
@ScottMaclure
ScottMaclure / jasmineBootStrapSpec.js
Created October 31, 2012 22:11
Jasmine Bootstrap
/**
* Basic skeleton for a Jasmine spec file, to test a jQuery plugin.
*/
describe("myPlugin specs", function () {
var $container;
/**
* Mock mininum amount of html required for plugin to operate.
*/
@ScottMaclure
ScottMaclure / gist:3816175
Created October 2, 2012 04:31
Gutter clicks on page
$("body").off("click");
$("body").on("click", function(event) {
console.log("body click pageX: " + event.pageX + " pageY: " + event.pageY);
if (typeof event.pageX === "undefined" || typeof event.pageY === "undefined") {
console.log("Not a user-originated click event, aborting.");
return;
}