Skip to content

Instantly share code, notes, and snippets.

View tmaslen's full-sized avatar

Tom Maslen tmaslen

View GitHub Profile
function ctm() { var u = 'undefined'; return ((typeof document.querySelector !== u) && (typeof localStorage !== u) && (typeof window.addEventListener !== u)) ? true : false;}
function ctm() {var u='undefined';return typeof document.querySelector!==u && typeof localStorage!==u && typeof window.addEventListener!==u ? true:false;}
function ctm(){return 'querySelector' in document && 'localStorage' in window && 'addEventListener' in window ? true:false}
function ctm(){try{return 'querySelector' in document && 'localStorage' in window && 'addEventListener' in window ? true:false;}catch(){return false}}
function ctm(){return 'querySelector' in document && 'localStorage' in window && 'addEventListener' in window}
function aboveFold(obj) {
var curtop = 0;
if (obj.offsetParent) {
do {
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
}
else {
curtop = obj.offsetTop;
}
<?php
class BBC_News_Core_Controller_BaseController extends BBC_Controller_Action
{
protected $container;
/**
* Primarily intended for extending the constructor.
* Initializing resources used in the controller
TomMaslenXXL:workspace maslet02$ rake tools:concat_js
rake aborted!
No such file or directory - tabloid/webapp/static/js/js_to_concat.js
Tasks: TOP => tools:concat_js
(See full trace by running task with --trace)

Image quality research

Summary:

After looking into the issue of the image quality of Visual Journalism output on the News website we have decided that there are a number of actions we can take:

  • Visual Journalism upload larger sized images (976px as a minimum). These will then be down scaled rather than upscaled.

  • Increase use of art direction tooling (AI2RWD for example).

@tmaslen
tmaslen / gist:5425445
Created April 20, 2013 09:50
I had to comment it out to make my single instance of apache (yes, I no longer have 3 apaches running) not error.
# ProxyPass / http://pal.sandbox.dev.bbc.co.uk/
# ProxyPass / http://static.sandbox.dev.bbc.co.uk/
# ProxyPreserveHost on
@tmaslen
tmaslen / gist:5704427
Last active December 18, 2015 01:29
Lets make a page we can put on responsivenews.co.uk to tell people what its like to work here. Its just something we can point people to when we don't/in addition to a job ad. It annoys me that we don't have something like this.

Working in the BBC News dev team

  • Awesome product
    • Responsive, mobile first. performance
    • Work with a world class journalism team
    • 100s of millions of users
    • Everyone in the world will know your product (watch people use your code on the train/bus while commuting into work)
  • The role
  • Skillset
  • World class front end HTML5 / CSS3
// How I have to do it
@mixin image {
background: #ccc;
margin: 0 0 1.5em;
padding-top: 4px;
p {
color: #666;
@tmaslen
tmaslen / gist:7251107
Last active December 27, 2015 02:19
Coin Test

BBC Coin Algorithm Test

DEVELOPER ASSESSMENT

Summary

Write a simple JavaScript application that given a number of pennies will calculate the minimum number of Sterling coins needed to make that amount.

Eg. 123p = 1 x £1, 1 x 20p, 1 x 2p, 1 x 1p

import BBC.AWS.CloudFormation
from BBC.AWS.CloudFormation import SQS, IAM
from BBC.AWS.CloudFormation.Common.ResourcePermissions import SQSActions
try: import json
except ImportError: import simplejson as json
template = BBC.AWS.CloudFormation.Template()
template.description = (