Skip to content

Instantly share code, notes, and snippets.

View Mottie's full-sized avatar
💭
🥞

Rob Garrison Mottie

💭
🥞
View GitHub Profile
@Mottie
Mottie / stylus-error.json
Last active March 18, 2024 11:45
Stylus update error test
[
{
"enabled": true,
"updateUrl": "https://gist.github.com/Mottie/32acd89f2df44aaba94db367933cffdf/raw/5b291b59208ffbf1b74057e07923d0cd3cdc0fce/test.user.css",
"md5Url": null,
"originalMd5": null,
"installDate": 1542676678468,
"sourceCode": "/* ==UserStyle==\n@name _test\n@namespace github.com/openstyles/stylus\n@version 0.1.0\n@description A new userstyle\n@author Me\n@var color bg \"background\" #000\"\n@updateURL https://gist.github.com/Mottie/32acd89f2df44aaba94db367933cffdf/raw/5b291b59208ffbf1b74057e07923d0cd3cdc0fce/test.user.css\n==/UserStyle== */\n@-moz-document domain(\"google.com\") {\n body {\n background: var(--bg) !important;\n }\n}",
"sections": [
{
@Mottie
Mottie / gist:461488
Last active February 5, 2023 22:04
Improved jQuery :contains() selector
/* jQuery selector to match exact text inside an element
* http://wowmotty.blogspot.com/2010/05/jquery-selectors-adding-contains-exact.html
* :containsExact() - case insensitive
* :containsExactCase() - case sensitive
* :containsRegex() - set by user ( use: $(el).find(':containsRegex("/(red|blue|yellow)/gi")') )
*/
$.extend( $.expr[":"], {
containsExact: $.expr.createPseudo ?
$.expr.createPseudo(function(text) {
return function(elem) {
@Mottie
Mottie / README.md
Last active December 27, 2022 20:33
Reset WAVE Evaluation Tool Bookmarklet

Bookmarklet to reset WAVE

WAVE is a browser extension used to test the accessibility of a web page. It alters the HTML to add indicators thoughout the page, but unfortunately there isn't a way to remove this indicators. That's where this bookmarklet comes in. When you're done with the evaluation, click on this bookmarklet, and all the indicators will disappear.

Important note: This is not a perfect solution. This bookmarklet is only removing the indicators, but not actually reseting WAVE. So if you need to run WAVE again, you will likely need to Run it twice to open the WAVE side panel and apply the indicators again.

Download

Download the wave-reset.html file included in this Gist

@Mottie
Mottie / ipv6.js
Last active July 29, 2021 00:58
[JS] Expand Abbreviated IPv6 Addresses (with support for embedded IPv4 Address)
// [JS] Expand Abbreviated IPv6 Addresses
// by Christopher Miller
// http://forrst.com/posts/JS_Expand_Abbreviated_IPv6_Addresses-1OR
// Modified to work with embedded IPv4 addresses
function expandIPv6Address(address)
{
var fullAddress = "";
var expandedAddress = "";
var validGroupCount = 8;
var validGroupSize = 4;
@Mottie
Mottie / jquery.tablesorter.pager.js
Created April 16, 2014 23:34
Tablesorter pager v2.15.14 modified to use deferred objects
/*!
* tablesorter pager plugin
* updated 4/16/2014 (v2.15.14-mod); requires jQuery 1.5+
*/
/*jshint browser:true, jquery:true, unused:false */
;(function ($) {
"use strict";
/*jshint supernew:true */
var ts = $.tablesorter;
@Mottie
Mottie / Change-last-url-value.html
Last active April 3, 2021 12:08
Useful Bookmarklets
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><A HREF="javascript:(function(){%20var%20e,s;%20IB=-1;%20function%20isDigit(c)%20{%20return%20(%220%22%20<=%20c%20&&%20c%20<=%20%229%22)%20}%20L%20=%20location.href;%20LL%20=%20L.length;%20for%20(e=LL-1;%20e>=0;%20--e)%20if%20(isDigit(L.charAt(e)))%20{%20for(s=e-1;%20s>=0;%20--s)%20if%20(!isDigit(L.charAt(s)))%20break;%20break;%20}%20++s;%20if%20(e<0)%20return;%20oldNum%20=%20L.substring(s,e+1);%20newNum%20=%20%22%22%20+%20(parseInt(oldNum,10)%20+%20IB);%20while%20(newNum.length%20<%20oldNum.length)%20newNum%20=%20%220%22%20+%20newNum;%20location.href%20=%20L.substring(0,s)%20+%20newNum%20+%20L.slice(e+1);%20})();" ADD_DATE="1257995008" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAWklEQVQ4jWNkYGBgiJ8i8J+BDLAw5wMjI7maYYCJEs2D3IAF2e8ZFmS/J88AYjTCAEYsENKcMFWQsAtIAVjTAbIr0G1EB1hdQEgTQReQAgZxQiIWMDIwUJadASvGHReRAe+EAAAAAElFT
@Mottie
Mottie / convert-date-in-md.js
Created January 18, 2018 20:32
Convert M/D/YYYY format to YYYY-MM-DD in all markdown files in current folder
#!/usr/bin/env node
"use strict";
/* Convert date formats in markdown
*
* This script converts a "(M/D/YYYY)" date format to "(YYYY-MM-DD)" in *all*
* markdown files within the folder it is placed
* Use `node convert-date-in-md.js` to execute
*/
const fs = require("fs");

Keybase proof

I hereby claim:

  • I am mottie on github.
  • I am regarr (https://keybase.io/regarr) on keybase.
  • I have a public key ASAWyWLYRvPE3Wqv-L_9Su6zF5ZuqlJZVyS4vePezJ2ZBAo

To claim this, I am signing this object:

// white space testing
// ok
// test 2
// test
function test( ) {
console.log('ok' ); // 123
}
/*
@Mottie
Mottie / demo.css
Created October 23, 2018 05:48
Input-password-bullet-css
/* Use the css below to change the password input symbol */
@font-face {
font-family: 'fontello';
src: url('./font/fontello.eot?0000');
src: url('./font/fontello.eot?0000#iefix') format('embedded-opentype'),
url('./font/fontello.woff2?0000') format('woff2'),
url('./font/fontello.woff?0000') format('woff'),
url('./font/fontello.ttf?0000') format('truetype'),
url('./font/fontello.svg?0000#fontello') format('svg');
font-weight: normal;