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
- {% if hover_platforms %}
- <li class="action-bar--hover__item sharing-btn--c-{{name}}">
+ {% for platform in hover_platforms %}
+ <li class="action-bar--hover__item sharing-btn--c-{{platform.name}}">
{% include "action-bar/share-button.html" %}
{% if is_link %}{% include "action-bar/link-button-tooltip.html" %}{% endif %}
</li>
- {% endif %}
+ {% endfor %}
#! /bin/zsh
autoload -U zmv
zmv -C '(**/)(*).mustache' '$1$2.html'
for file in **/*.html; do
echo "Converting: $file";
# Comments
perl -0777 -pi -e 's/{{\!(.*?)}}/{#$1#}/s' $file
# Partials
perl -pi -e 's/{{> ?(\S+) ?}}/{% include "$1.html" %}/g' "$file"
# Block
decorator==4.0.6
ipdb==0.8.1
ipython==4.0.1
ipython-genutils==0.1.0
path.py==8.1.2
pexpect==4.0.1
pickleshare==0.5
ptyprocess==0.5
simplegeneric==0.8.1
traitlets==4.0.0
(function(){
var o={'uk':1,
'ck':1,
'ad':0,
'ap':0,
'tb':0,
'mb':0,
'eu':0};
window.orb=window.orb||{};
window.fig=window.fig||{};
#!/bin/bash
# Usage:
# ./charles.sh on
# ./charles.sh off
# sed needs write permissions to the parent folder to create temp file
sudo chmod -R 777 /usr/share/php/Zend/Http/Client/Adapter
sudo chmod -R 777 /usr/share/php/BBC/Http/Multi/Client/Adapter/
if [ $1 = "on" ]; then
grunt pngmin
Running "pngmin:pngmin" (pngmin) task
Optimization would increase file size by 3 % so optimization was skipped on file img/brand/generated/afrique-light.png
Optimization would increase file size by 55 % so optimization was skipped on file img/16-baseline.png
Optimization would increase file size by 12 % so optimization was skipped on file img/brand/generated/arabic-light.png
Optimization would increase file size by 3 % so optimization was skipped on file img/brand/generated/azeri-light.png
Optimization would increase file size by 2 % so optimization was skipped on file img/brand/generated/bengali-light.png
Optimization would increase file size by 2 % so optimization was skipped on file img/brand/generated/burmese-light.png
Optimized img/blogs/queens_baton_relay.png [saved 57 % - 14.62 kB → 6.28 kB]
Optimization would increase file size by 2 % so optimization was skipped on file img/brand/generated/cymrufyw-light.png
@jcleveley-zz
jcleveley-zz / gist:3c0ca9f8294d5d98ed2e
Created May 28, 2015 10:11
Github pdf export styling
$('.header').remove()
$('.pagehead').remove()
$('.file-navigation').remove()
$('.commit').remove()
$('.file-header').remove()
$('.repository-sidebar').remove()
$('.site-footer').remove()
$('h2:contains("Top recommendations")').css('margin-top', '600px')
@jcleveley-zz
jcleveley-zz / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jcleveley-zz
jcleveley-zz / log.sh
Last active August 29, 2015 14:15
Log analysis
pv www.bbc.co.uk | sed -E -e "s/(&|\?|#|\'|\%).*$//g" -e "s/ //g" | Ack "^www.bbc.co.uk/news/" | sort | uniq -c | sort -nr > news_unique.log
cat news_unique.log | sed -E 's/^.+www\.bbc\.co\.uk/ - /g' > news_unique_url.yaml
@jcleveley-zz
jcleveley-zz / zsh.md
Last active March 21, 2016 14:18
Zsh tips

Path replacement

Moving from: /www/site1/media/css/main to /www/site2/media/css/main can be a pain, but not in zsh:

cd site1 site2