Skip to content

Instantly share code, notes, and snippets.


Tom Maslen tmaslen

View GitHub Profile
tmaslen / gist:8845924
Last active Aug 29, 2015
Example of adding a right to left class depending on language
View gist:8845924
var className = "";
if (["ar", "es"].indexOf(translations[vocab_dir].lang) > -1) {
className = "rtl";
<body class="<%= className %>">
View gist:8999703
env -l
env: illegal option -- l
usage: env [-i] [name=value ...] [utility [argument ...]]
jake:responsive-news maslet02$ man env
jake:responsive-news maslet02$
jake:responsive-news maslet02$ env list
env: list: No such file or directory
jake:responsive-news maslet02$ env help
env: help: No such file or directory
jake:responsive-news maslet02$ env
View gist:d9b11fc72ff639635c9a
# window.onerror
Not needed anymore now dev tools are so sophisticated, you can tell the browser to pause on error and then get a full stack trace and a list of all variables in the current scope.
# Don't tell people to do this:
var calc = function calc (a, b) { return a * b; }
tmaslen / gist:8a9e1f879a0c4a50146c
Created Jun 10, 2014
Telegraph interactive loading. If mobile adds a link to open in seperate window, if desktop adds the interactive with an iframe.
View gist:8a9e1f879a0c4a50146c
<script type="text/javascript">
var parentElm = document.getElementsByTagName('script'),
domOutput = document.createElement('div');
parentElm = parentElm[ parentElm.length-2 ];
if(Telegraphics.Modernizr.mobileonmobilesite) {
var lnk=document.createElement('link');
View gist:a1924b76f9b4d5140927
if ((!document.addEventListener) || (!Array.prototype.indexOf) || (!Array.prototype.forEach) ) {
document.write('<sc' + 'ript src=""></sc' + 'ript>');
<a href="" id="responsive-iframe-98623215" data-static-iframe-height="600">iFrame</a>
tmaslen / gist:d141e0e25e0beb807fc3
Created Jul 18, 2014
notes for a potential presentation about the iframe scaffold
View gist:d141e0e25e0beb807fc3
iframe scaffold
## The problems
* current stuff keeps breaking on responsive
* need to deploy our work to apps
* We're going to move away from our existing infrastructure
View gist:7868e548e77c57b5bf94

it appears that the URL(s) in question relate(s) to matters of substantial interest to the public regarding your professional life

Its the opinion of a child, they may be interesting to the public but they are massively subjective and potentially reputationaly damaging. My partner has some of the highest exam grades in the school - this is not subjective, but the results are not published to the web with her name associated to them. She is strict so some of the pupils don't like her despite the results she gets and yet these children can dirty her reputation with a single, anonymous comment.

These URLs appear at the top of google searches for her name. And they were also written a long time ago. How can you allow this to happen to a teacher, a person of the highest integrity who gives everything to her profession for the betterment of society.

I'm massively disappointed in Google, cases like this are the reason why this law was created.

Regards, Tom Maslen.

View gist:ff13a644f6395a0d5a2d
What we do, who we are
BBC :: News :: Visual Journalism :: Dev Team
> Team of 9 developers and 1 tester responsible for
* DAILY TASKS Very quick, normally predefined, tasks that a developer will do at
View gist:146020
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en-GB" lang="en-GB">
<head profile="">
<title>Change Password</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<form action="" id="changepw" name="changepw" method="post">