Skip to content

Instantly share code, notes, and snippets.

Olly Hodgson OllyHodgson

View GitHub Profile
@OllyHodgson
OllyHodgson / modernizr-ielegacyfilters.js
Last active Dec 16, 2015
Modernizr test for legacy IE Filters and Transitions (COMPLETELY UNTESTED!)
View modernizr-ielegacyfilters.js
/*
Modernizr test for legacy IE Filters and Transitions
I haven't tested this with Modernizr! Just adapted my solution to look like
https://gist.github.com/farmdawgnation/2636061
Needed because Filters and Transitions can be disabled under IE's security
settings ("Binary and Script Behaviors" under the "ActiveX controls and
plug-ins" category). This is often done on corporate windows installations
"for security reasons". They'll fail silently (or error if you try to access
@OllyHodgson
OllyHodgson / detectIEfiltersupport.js
Last active Dec 16, 2015
Test for IE legacy Filters and Transitions support
View detectIEfiltersupport.js
/*
Test if this install of IE supports legacy Filters and Transitions
Needed because Filters and Transitions can be disabled under IE's security
settings ("Binary and Script Behaviors" under the "ActiveX controls and
plug-ins" category). This is often done on corporate windows installations
"for security reasons". They'll fail silently (or error if you try to access
the element's filter collection in js). This setting also disables VML.
See:
@OllyHodgson
OllyHodgson / sparkline.svg
Created Jan 7, 2013
Stuart Langridge's Simple SVG sparklines — http://kryogenix.org/days/2012/12/30/simple-svg-sparklines — but using an object element instead of an embed.
View sparkline.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@OllyHodgson
OllyHodgson / encoding.htm;
Created Nov 30, 2012
While testing a system, we found some "interesting" HTML encoding behaviour. For a given value of "interesting", obviously.
View encoding.htm;
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Escaping fun!</title>
</head>
<body>
<!-- Renders as 'abcd' -->
<p>abcd<efg</p>
<!-- Renders as 'abcd<&efg' -->
@OllyHodgson
OllyHodgson / buttons.css
Created Oct 11, 2012
Remarkably similarly stlyed buttons across IE7/8/9, FF, Chrome, Safari and Opera
View buttons.css
/******************************************************************
*
* COMPONENTS: BUTTONS AND BUTTON-STYLE LINKS
* e.g. <button>Click me!</button>
* or <a class="button">Click me!</a>
* or <input type="submit" value="Click me!" />
*
******************************************************************/
.outer a.button,
.outer a.button:link,
@OllyHodgson
OllyHodgson / dabblet.css
Created Oct 3, 2012 — forked from cahnory/dabblet.css
Box shadow art, CSS transitions, via https://gist.github.com/cahnory
View dabblet.css
/**
* Box shadow art, CSS transitions, via https://gist.github.com/cahnory
*/
.image1 {
background: red;
font-size: 10px;
height: 1em;
width: 1em;
/* Drawing */
@OllyHodgson
OllyHodgson / Regex for removing SharePoint Designer 2010 specific markup
Created Aug 29, 2012
Opening an .aspx in SharePoint Designer 2010 litters it with SPD-specific markup. This removes most (if not all) of it. Note I run this one in Sublime Text 2, other editors might need some tweaking. Also note the leading space.
@OllyHodgson
OllyHodgson / SP2010-ContentType-to-HTML.js
Last active Oct 6, 2015
Scrapes a Sharepoint 2010 Content Type page to get the column names and display names. Outputs some HTML or the FieldNames needed for a page layout file. Exceedingly limited, but does what I need it to.
View SP2010-ContentType-to-HTML.js
/*
Run this against a content type page to get the HTML for the columns!
els = array of elements
type = "li"|"td"|"th"|"FieldRef"
*/
function create(el, type) {
var fieldname,
displayname,
outputHTML = '';
@OllyHodgson
OllyHodgson / more-buttons.html
Created Aug 4, 2011
More experiments with HTML+CSS button styling
View more-buttons.html
<!DOCTYPE html>
<html>
<head>
<title>Button styles</title>
<style>
/******************************************************************************
Reset styles
Based on Eric Meyer's fine work: http://meyerweb.com/eric/tools/css/reset/
@OllyHodgson
OllyHodgson / jquery.imgresizer.js
Created Jul 27, 2011
Image scaling in IE6 and 7 is bobbins. This script uses Microsoft's proprietary filter gubbins to make it better.
View jquery.imgresizer.js
/*
IMGRESIZER
Image scaling in IE6 and 7 is bobbins. This uses their proprietary filter gubbins to make it better.
Original by Ethan Marcotte, at http://unstoppablerobotninja.com/entry/fluid-images/
Rejigged by Olly Hodgson.
So Ethan [@beep] wrote a script that'll make IE6 and 7 on Windows resize
images beautifully [http://unstoppablerobotninja.com/entry/fluid-images/]
(without the performance hit you take from using -ms-interpolation-mode:
bicubic;). Tom H pointed out in the comments that it broke the right-click
You can’t perform that action at this time.