Skip to content

Instantly share code, notes, and snippets.

View OllyHodgson's full-sized avatar

Olly Hodgson OllyHodgson

View GitHub Profile
@yukulele
yukulele / jquery.wordify.js
Created January 28, 2014 14:49
wrap each word in a span
$.fn.wordify = function(){
this.find(":not(iframe,textarea)").addBack().contents().filter(function() {
return this.nodeType === 3;
}).each(function() {
var textnode = $(this);
var text = textnode.text();
text = text.replace(/([^\s-.,;:!?()[\]{}<>"]+)/g,'<span>$1</span>');
textnode.replaceWith(text);
});
return this;
@mattjohnsonpint
mattjohnsonpint / SPTZ.csv
Last active October 21, 2020 12:11
SharePoint time zone mappings
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
"SharePoint ID","SharePoint Description","Windows Display Name","Windows ID","IANA Time Zone"
"2","(UTC) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London","(UTC) Dublin, Edinburgh, Lisbon, London","GMT Standard Time","Europe/London"
"3","(UTC+01:00) Brussels, Copenhagen, Madrid, Paris","(UTC+01:00) Brussels, Copenhagen, Madrid, Paris","Romance Standard Time","Europe/Paris"
"4","(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna","(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna","W. Europe Standard Time","Europe/Berlin"
"5","(UTC+02:00) Athens, Bucharest, Istanbul","(UTC+02:00) Athens, Bucharest","GTB Standard Time","Europe/Bucharest"
"6","(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague","(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague","Central Europe Standard Time","Europe/Budapest"
"7","(UTC+02:00) Minsk","(UTC+03:00) Kaliningrad, Minsk","Kaliningrad Standard Time","Europe/Kaliningrad"
"8","(UTC-03:00) Brasilia","(UTC-03:00) Brasilia","E. South Ameri
@eikes
eikes / getElementsByClassName.polyfill.js
Created April 4, 2012 08:04
Polyfill for getElementsByClassName
// Add a getElementsByClassName function if the browser doesn't have one
// Limitation: only works with one class name
// Copyright: Eike Send http://eike.se/nd
// License: MIT License
if (!document.getElementsByClassName) {
document.getElementsByClassName = function(search) {
var d = document, elements, pattern, i, results = [];
if (d.querySelectorAll) { // IE8
return d.querySelectorAll("." + search);
@sibelius
sibelius / flow-redux.guideline.md
Created November 10, 2017 16:23
How to easily type Redux Props with Flow

How to easily type Redux Props with Flow

Add ExtractReturn helper

// https://hackernoon.com/redux-flow-type-getting-the-maximum-benefit-from-the-fewest-key-strokes-5c006c54ec87
// https://github.com/facebook/flow/issues/4002
// eslint-disable-next-line no-unused-vars
type _ExtractReturn<B, F: (...args: any[]) => B> = B;
export type ExtractReturn = _ExtractReturn&lt;*, F&gt;;
@ech01
ech01 / DnnScheduleExample.cs
Last active September 13, 2021 18:41
DNN Scheduler Example
using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;
using DotNetNuke.Services.Mail;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Portals;
@paulrouget
paulrouget / ff.md
Last active November 21, 2021 21:13
Hacking Firefox
@ggravarr
ggravarr / moment-timezone.js
Created July 29, 2016 20:42
flow-typed moment definition with moment-timezone added
type moment$MomentOptions = { // eslint-disable-line no-unused-vars
y?: number|string,
year?: number|string,
years?: number|string,
M?: number|string,
month?: number|string,
months?: number|string,
d?: number|string,
day?: number|string,
days?: number|string,
@bdukes
bdukes / NoDefaultCss.ascx
Created April 11, 2016 21:11
Replace or Remove DNN's Default CSS
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
<dnn:DnnCssExclude runat="server" Name="dnndefault" />
@char0n
char0n / start.js
Last active May 5, 2022 21:47
Create React App override for start script using rewire library
const path = require('path');
const rewire = require('rewire');
process.chdir(path.join(__dirname, '..'));
const start = rewire('react-scripts/scripts/start.js')
const configFactory = start.__get__('configFactory');
const configFactoryMock = (webpackEnv) => {
const config = configFactory(webpackEnv);
@krisbulman
krisbulman / countCSSRules.js
Last active August 25, 2022 19:53 — forked from psebborn/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE. — This snippet has been modified to count more than just the first level of CSSStyleRule objects within CSSMediaRule.
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {