Skip to content

Instantly share code, notes, and snippets.

View OllyHodgson's full-sized avatar

Olly Hodgson OllyHodgson

View GitHub Profile
@farmdawgnation
farmdawgnation / modernizr-vml.js
Created May 8, 2012 15:08
Modernizr Test for VML
// Add a Modernizr check for VML
Modernizr.addTest('vml', function() {
// Adapted from http://stackoverflow.com/questions/654112/how-do-you-detect-support-for-vml-or-svg-in-a-browser
var a = document.body.appendChild(document.createElement('div'));
a.innerHTML = '<v:shape id="vml_flag1" adj="1" />';
var b = a.firstChild;
b.style.behavior = "url(#default#VML)";
var supportsVml = b ? typeof b.adj == "object": true;
a.parentNode.removeChild(a);
return supportsVml;
@kulor
kulor / dropshadow-ie7.css
Created August 3, 2012 13:32
ie image dropshadow support
/*
Dropshadow handling in IE vs. native box-shadow support
- Normal box-shadow on .dropshadow
/////////////////////
/ +===============+ /
/ | | /
/ | | /
/ | | /
@nefarioustim
nefarioustim / wiki.md
Created September 19, 2012 15:34
Wikiman's Creed

This is my wiki. There are many like it, but this one is mine.

My wiki is my best friend. It is my life. I must master it as I must master my life.

My wiki, without me, is useless. Without my wiki, I am useless. I must wiki true. I must wiki better than my enemy who is trying to out wiki me. I must wiki him before he wikis me. I will...

My wiki and myself know that what counts in this war is not the docs we type, the users who read, or the communities we forge. We know that it is the wikis that count. We will hit...

My wiki is human, even as I, because it is my life. Thus, I will learn it as a brother. I will learn its weaknesses, its strength, its parts, its accessories, its widgets and its syntax. I will keep my wiki clean and ready, even as I am clean and ready. We will become part of each other. We will...

@OllyHodgson
OllyHodgson / buttons.css
Created October 11, 2012 17:17
Remarkably similarly stlyed buttons across IE7/8/9, FF, Chrome, Safari and Opera
/******************************************************************
*
* 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,

Lesson's learnt building the Guardian

Below is a collection of my favourite responses I gathered from Guardian engineers when asked the question: What have you learnt starting from scratch and building a mobile-first next generation web platform for the Guardian?

Daithi O Crualaoich

  • Work with great people.
  • Deploy like crazy. This means the team has to control the infrastructure as well as code.
  • Design is not a service. Designers have to sit in the team.
  • Infrastructure is intrinsically unreliable. Discard and replace is the robust strategy.
  • Use your CDN for HTML too.
  • Don't always do as you are told.
@WebReflection
WebReflection / gist:24c4c475bdeb59405e87
Last active February 15, 2016 15:56
setTimeout and setInterval extra arguments

Every single JavaScript engine supports standard timers *

These accept one or more extra argument by specs

for(var i = 0; i < 2; i++) {
  setTimeout(function (i) {
    console.log(i);
  }, 0, i); // <== see this?
}
@emilbjorklund
emilbjorklund / breakpoints_via_css.html
Created April 24, 2012 16:03
Width detection via sneaky CSS rules
<!DOCTYPE html>
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<title>Breakpoint detection test</title>
<style type="text/css" media="screen">
@media screen and (min-width: 320px) {
#page:after {
content: 'smallest'; /* represent the current width-bracket */
@donker
donker / Login.ascx
Created March 7, 2019 08:47
Login screen skin page for DNN
<%@ Control language="VB" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %><%@ Register TagPrefix="connect" Namespace="Connect.DNN.Modules.SkinControls" Assembly="Connect.DNN.Modules.SkinControls" %><%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %><%@ Register TagPrefix="dnn" TagName="MENU" Src="~/DesktopModules/DDRMenu/Menu.ascx" %>
<%@ Register TagPrefix="dnn" TagName="PRIVACY" Src="~/Admin/Skins/Privacy.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TERMS" Src="~/Admin/Skins/Terms.ascx" %>
<dnn:DnnCssInclude runat="server" FilePath="css/bootstrap.min.css" PathNameAlias="SkinPath" />
<dnn:DnnCssInclude runat="server" FilePath="css/font-awesome.min.css" PathNameAlias="SkinPath" />
<dnn:DnnCssInclude runat="server" FilePath="css/sb-admin-2.min.css" PathNameAlias="SkinPath" />
<dnn:DnnCssInclude runat="server" FilePath="dnndefault/8.0.0/default.css" PathNameAlias="SharedScripts" Name="dnndefault" Version="8.0
@technopagan
technopagan / style.css
Created December 5, 2012 12:49 — forked from iansoper/dabblet.css
Progressive Enahncement to use SVG sprites with PNG fallback for IE6+7
/**
* Progressive Enahncement to use SVG sprites with PNG fallback for IE6+7
*
* The trick:
* Legacy IE does not support rgba values.
* By defining a rgba background color together with the
* SVG background image for all modern browsers, legacy IE
* will ignore the SVG and use the
* first background definition containing the fallback PNG
*
@sequielo
sequielo / gist:3086192
Created July 10, 2012 20:58
createCookie with JS
//! from http://www.quirksmode.org/js/cookies.html
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";