Skip to content

Instantly share code, notes, and snippets.

View tobystokes's full-sized avatar

Toby Stokes tobystokes

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tobystokes on github.
  • I am tobystokes (https://keybase.io/tobystokes) on keybase.
  • I have a public key ASAkfwJP7XGe2sTmuD-2Qe6E_b2D7qDfYkYgWSQQDhUZkQo

To claim this, I am signing this object:

@tobystokes
tobystokes / .eleventy.js
Last active April 3, 2022 23:47
eleventy-img caching
const imageShortcode = require("./image");
module.exports = function(eleventyConfig) {
eleventyConfig.addNunjucksShortcode("image", imageShortcode);
// ... + other eleventyConfig
};
@tobystokes
tobystokes / cookies.css
Created March 10, 2021 15:02
CSS overrides for SMG CookiePro
/* add link:
document.head.insertAdjacentHTML('beforeend','<link rel="stylesheet" id="onetrust-custom" href="https://group.smg.localhost/wp-content/themes/smgwptheme/css/cookies.css" type="text/css">');
*/
#onetrust-pc-sdk .ot-pc-footer-logo {
display: none;
}
#onetrust-banner-sdk #onetrust-policy-text,
#onetrust-banner-sdk .ot-b-addl-desc,
{
"sections": [
{
"name": "similarity",
"description": "",
"scores": [
{ "type": "score", "name": "Marginal distribution" },
{ "type": "score", "name": "Bi-joint distribution" },
{ "type": "score", "name": "Mutual Information"}
],
{"traces": [
{
"y": ["accuracy", "f1", "precision", "recall"],
"x": [
0.8717948717948718,
0.7141389934953782,
0.770879526977088,
0.6651785714285714
],
"name": "real",
@tobystokes
tobystokes / tnew.js
Last active April 18, 2018 12:31
Modify max/min versions of select values
$(function() {
// Make sure jquery is loaded.
// the title of the selectlist = the Tessitura price type.
$('select[title=44] option').filter(function() {
return $(this).val() < 10;
}).remove();
$('select[title=44] option').filter(function() {
Registered in England № 10455912, 60 Gray’s Inn Road, Unit G1, London, England, WC1X 8AQ. Homelyfe is a trading name of AG Lyfe Ltd (FCA Registration 775185), which is an appointed representative of Vibe MGA Management Ltd (FCA Registration 770419), which is authorised and regulated by the Financial Conduct Authority.
// line 27ish
// ID selectors are naughty!
// The :active state only applies if .active isn't
li.active .c-btn-filter,
li:not(.active) .c-btn-filter:active,
li:not(.active) .c-btn-filter:focus {
color: grey(80);
@tobystokes
tobystokes / gist:22824647af13d2808e65d0fd3997d9b7
Last active May 25, 2017 09:56
Generate self signed cert for local development, without Chrome SAN warnings
# replace [local.dev] with your domain
# You will still get ERR_CERT_COMMON_NAME_INVALID - but that can be solved by using the standard add to keychain and trust method
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout server.key \
-new \
-out server.crt \
/// Function to get next map item
/// returns next map item or fallback value if map, key or next item does not exist
///
/// @author Simon Koch, Toby Stokes
///
/// @access public
///
/// @param {Map} $map - Sass list map
/// @param {String} $key - List map key of the current item
/// @param {String} $fallback (false) - Fallback value if map, key or next item does not exist. If this is 'loop' then returns the first item in the list