Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><![CDATA[ACER Discover]]></title>
<link>https://www.acer.org/discover</link>
@TemporaryJam
TemporaryJam / radios-and-checkboxes.html
Created May 16, 2019 23:24
Accessible custom styled radios and checkboxes - 100% CSS IE10+
<!DOCTYPE html>
<head>
<title>A11y radios</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<style>
.section input[type="radio"],
.section input[type="checkbox"]{
https://stackoverflow.com/questions/38194032/how-to-update-ruby-version-2-0-0-to-the-latest-version-in-mac-osx-yosemite#
$ brew update
$ brew install rbenv ruby-build
$ rbenv init
rbenv install --list
rbenv install 2.4.4
rbenv global 2.4.4
rbenv rehash
@TemporaryJam
TemporaryJam / extension_end_script.patch
Last active June 3, 2019 03:41
Stop ExpressionEngine nested hook calls from failing when using the end_script flag in a nested call.
From 2c06ccd60184aeb56e13692b42559247c552265a Mon Sep 17 00:00:00 2001
Date: Fri, 4 May 2018 16:19:02 +1000
Subject: [PATCH] Patching EE extension bug where a nested call to extensions
and use of end_script will exit all currently running hooks instead of just
the current one
---
public/system/ee/legacy/libraries/Extensions.php | 33 +++++++++++++++++++++---
1 file changed, 29 insertions(+), 4 deletions(-)
@TemporaryJam
TemporaryJam / forms.js
Last active June 3, 2019 03:42
Get comma separated list of forms from FormAssembly
names = $('.form-name');
ids = $('.slds-text-heading--label');
mod = $('.slds-grid + .slds-text-body--small');
//Add <pre id="target"></pre> near top of page
$('#target').text('');
for (var i = 0; i < names.length; i++) {
$('#target').text($('#target').text() + $(names[i]).text().trim() + ', ' + $(ids[i]).text().trim() + ', ' + $(mod[i]).text().trim() + '\n');
}
@TemporaryJam
TemporaryJam / detect-click-outside.js
Created July 21, 2015 06:17
Detect a click outside of an element
$(document).click(function(event) {
if(!$(event.target).closest('#id-of-thing-youre-detecting-the-click-outside-of').length) {
//close something or do something
}
});
- Check for opcode caching (APC), built into PHP 5.5+, check it is enabled.
function fireGaEvent(category, action, label, value)
{
if (null === category) {
category = 'Professional Learning';
}
if (ga) {
if (value !== undefined && value !== '') {
ga('send', 'event', category, action, label, value);
} else {
ga('send', 'event', category, action, label);
@TemporaryJam
TemporaryJam / PHP Download
Created June 2, 2015 04:04
PHP downloader with range support
<?php
/**
* Copyright 2012 Armand Niculescu - MediaDivision.com
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PR
@TemporaryJam
TemporaryJam / Magento category fix
Created November 18, 2014 17:03
Magento categories not showing in admin
/** Check integrity */
SELECT c.entity_id, c.children_count as original_children_count, COUNT(c2.children_count) as `children_count`, c.level as original_level, (LENGTH(c.path)-LENGTH(REPLACE(c.path,'/',''))) as `level`
FROM mage_catalog_category_entity c
LEFT JOIN mage_catalog_category_entity c2 ON c2.path like CONCAT(c.path,'/%')
GROUP BY c.path
/** Fix child counts */
UPDATE mage_catalog_category_entity SET children_count = (SELECT COUNT(*) FROM (SELECT * FROM mage_catalog_category_entity) AS table2 WHERE path LIKE CONCAT(mage_catalog_category_entity.path,"/%"));
/** more info */