Skip to content

Instantly share code, notes, and snippets.

View CoeusCC's full-sized avatar

Patrick Zeinert CoeusCC

View GitHub Profile
@CoeusCC
CoeusCC / gist:4392058
Created December 27, 2012 21:17
Using CSS to hide buttons in the SocialCount plugin has the unintended side effect of preventing the Google Plus button from functioning properly. I recommend using `display:block` until a better solution is identified.
.socialcount .button {
display: block;
width: 100%;
position: absolute;
left: 0;
bottom: -6px;
text-align: center;
pointer-events: none;
}
@CoeusCC
CoeusCC / Piwiki UserCountryMap load error
Created January 9, 2013 23:22
Error throw when loading UserCountryMap plugin update from https://github.com/gka/piwik-map-widget/
Uncaught TypeError: Object #<HTMLDivElement> has no method 'run'
(anonymous function)
o index.php:3
p.add index.php:3
e.fn.e.ready index.php:3
e.fn.e.init index.php:3
e index.php:3
(anonymous function)
(anonymous function) index.php:3
e.extend.globalEval index.php:3
@CoeusCC
CoeusCC / Piwiki UserCountryMap load error 2
Created January 9, 2013 23:35
Uncaught ReferenceError: $K is not defined
Uncaught ReferenceError: $K is not defined index.php:1704
UserCountryMap.run index.php:1704
(anonymous function)
o index.php:3
p.add index.php:3
e.fn.e.ready index.php:3
e.fn.e.init index.php:3
e index.php:3
(anonymous function)
(anonymous function) index.php:3
@CoeusCC
CoeusCC / countWordsInWpEditor
Created May 17, 2016 19:07
Target TinyMCE instance in WordPress post editor and return an estimated word count
function countWordsInWpEditor() {
var html;
var text;
var words;
var focusedTextField = document.getElementById("tinymce");
html = focusedTextField.innerHTML;
text = html.replace(/(<([^>]+)>)/ig,"")
words = text.split(" ");
function get_formatted_date(date_string) {
const raw = new Date(date_string);
const day = ("0" + raw.getDate()).slice(-2);
const month = ("0" + (raw.getMonth() + 1)).slice(-2);
const year = raw.getFullYear().toString().slice(-2);
return month + '/' + day + '/' + year;
}
function get_formatted_time(time_string) {
const raw = new Date(time_string);
const hour = raw.getHours();
const minute = ("0" + raw.getMinutes()).slice(-2);
const meridian = (hour < 13 ) ? 'AM' : 'PM';
return hour + ':' + minute + ' ' + meridian;
}
@CoeusCC
CoeusCC / cloudSettings
Created July 12, 2018 14:20
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-07-12T14:20:17.148Z","extensionVersion":"v2.9.2"}
export default class DataEvent {
constructor(type, payload, uuid) {
return {
uuid: uuid,
type: type,
payload: payload,
meta: {
version: {
series: "SERVICE",
number: 1