Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Maslen tmaslen

View GitHub Profile
@tmaslen
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
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
// http://www.telegraph.co.uk/sport/football/world-cup/10886068/England-World-Cup-team-selector.html
<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');
lnk.setAttribute('rel','stylesheet');
lnk.setAttribute('type','text/css');
View gist:a1924b76f9b4d5140927
<script>
if ((!document.addEventListener) || (!Array.prototype.indexOf) || (!Array.prototype.forEach) ) {
document.write('<sc' + 'ript src="http://local.bbc.co.uk:1031/news/special/2014/newsspec_7978/content/english/js/lib/vendors/legacy-ie-polyfills.js?v=0.1.0"></sc' + 'ript>');
}
</script>
<div>
<a href="http://local.bbc.co.uk:1031/news/special/2014/newsspec_7978/content/english/frame_1.html?v=0.1.0" id="responsive-iframe-98623215" data-static-iframe-height="600">iFrame</a>
</div>
<div>
@tmaslen
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
Also:
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
> BUILDING and SUPPORTING Visual Journalism's WEB CONTENT
There are THREE WORKFLOWS:
* 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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
<head profile="http://dublincore.org/documents/dcq-html/">
<title>Change Password</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<form action="" id="changepw" name="changepw" method="post">