Skip to content

Instantly share code, notes, and snippets.

View jcleveley-zz's full-sized avatar

John Cleveley jcleveley-zz

  • BuzzFeed
  • London
View GitHub Profile
#!/bin/bash
echo ""
echo "Here's what we're going to do:"
echo " "
echo "Add the following files"
echo "-----------------------"
svn status | awk '/^\?/ {print $2}'
echo " "
echo "Remove the following files"
echo "--------------------------"
/* Based on contribution from Sebastien http://www.amicalement-web.net/symfony-domptez-les-filtres-de-ladmin-generator/2009/06/16/
*/
#sf_admin_container #sf_admin_bar {
float:none;
margin: 0px;
}
#sf_admin_container #sf_admin_bar .sf_admin_filter table tr {
clear: none;
border: 1px solid #DDDDDD;
@jcleveley-zz
jcleveley-zz / assetic-inline-js.html
Created May 16, 2011 15:00
A proposal for using assetic to create inline javascript - useful for mobile development where you need to keep requests down.
<!-- Use case 1 - Minify inline javascript -->
{% javascripts filter="yui_js"%}
<script>
console.log('foo');
// these dissapear
//
</script>
{% endjavascripts %}
@jcleveley-zz
jcleveley-zz / patterns.js
Created June 15, 2011 10:44
Javascript patterns
// namespace - single global variable for all news JS
var news = news || {};
// Example of a singleton as a revealing module
// When you only need one of something
news.preferences = (function (app, global) {
// Private variables
var persistent = true;
@jcleveley-zz
jcleveley-zz / parallel.js
Created July 21, 2011 17:48
Are these parallel requests?
var request = require('request');
var factory = function(info) {
return function (error, response, body) {
if(response && response.statusCode === 200){
var obj = JSON.parse(body);
console.log(info.id, obj.likes);
} else {
@jcleveley-zz
jcleveley-zz / 1-developer.md
Last active September 27, 2015 22:48
Job Requirements

Developer

Context

BBC News is one of the most popular sites in the UK and is trusted worldwide to deliver quality journalism across multiple devices.

Since the launch of the new responsive News site for Mobile, which redefined what's possible with Responsive Web Design, we are now focussed on rolling this approach out to tablet and desktop and across the 30 languages the BBC produces news in. You will be helping to deliver some of the only unbiased journalism available in some parts of the world.

We're based in the centre of London in Broadcasting House, a brand new building which provides a great working environment and houses the largest News Room in Europe. You will be working right next to journalists giving you direct feedback from users.

7c7
< "id":"17549013_EnhancedMobile",
---
> "id":"17549013_HighWeb",
11c11
< "publisheddate":"2012-03-29T10:43:13+00:00",
---
> "publisheddate":"2012-03-29T10:43:12+00:00",
16c16
< "datetime":"2012-03-29T10:43:13+00:00",
<!-- XML from candy-->
<video media-id="57519164">
<caption>Different caption for the same video</caption>
</video>
<!-- HTML via XSLT-->
<video id="video-57519164"></video>
<!-- JS added into page by php from candy meta -->
<script>
var curl = {
baseUrl: '<?= $this->staticPrefix ?>/js/',
paths: {
curl: 'vendor/curl/curl',
'locator': '../../../locator/mobile/<?= $config['locatorVersion'] ?>/js/module/',
'module/index': '<?= ($this->compiledJs) ? 'compiled/all' : 'module/index' ?>',
'module/story': '<?= ($this->compiledJs) ? 'compiled/all' : 'module/story' ?>',
'module/live-event': '<?= ($this->compiledJs) ? 'compiled/all' : 'module/live-event' ?>',
"jquery-1": "http://static.test.bbci.co.uk/frameworks/jquery/0.1.8/sharedmodules/jquery-1.6.2",
"demi-1":"http://static.test.bbci.co.uk/frameworks/demi/0.9.8/sharedmodules/demi-1",
@jcleveley-zz
jcleveley-zz / gist:3447987
Created August 24, 2012 09:14
Push worked, but post-receive failed: Resource temporarily unavailable
Counting objects: 25, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 1010 bytes, done.
Total 13 (delta 12), reused 0 (delta 0)
remote: Push worked, but post-receive failed: Resource temporarily unavailable - Timeout reading from the socket
remote: /data/github/current/vendor/gems/ruby/1.8/gems/redis-2.2.0/lib/redis/client.rb:147:in `read'
remote: /data/github/current/vendor/gems/ruby/1.8/gems/redis-2.2.0/lib/redis/client.rb:38:in `call'
remote: /data/github/current/vendor/gems/ruby/1.8/gems/redis-2.2.0/lib/redis/client.rb:119:in `process'
remote: /data/github/current/vendor/gems/ruby/1.8/gems/redis-2.2.0/lib/redis/client.rb:227:in `ensure_connected'