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
@jcleveley-zz
jcleveley-zz / gist:60c32a5ba3853c54240a
Created August 22, 2014 10:11
Vagrant CoreOS for Docker
Vagrant.configure('2') do |config|
config.vm.box = "coreos"
config.vm.box_url = "http://storage.core-os.net/coreos/amd64-generic/dev-channel/coreos_production_vagrant.box"
config.vm.network "private_network", ip: "172.12.8.150"
config.vm.synced_folder ".", "/home/core/share",
id: "core",
:nfs => true,
:mount_options => ['nolock,vers=3,udp']
end
<form method="post" action="http://www.bbc.co.uk/cgi-bin/cgiemail/news24/newswatch.txt" id="feedback-comment-form">
<fieldset>
<input name="email_subject" type="hidden" value="Website errors">
<input name="mailto" type="hidden" value="[email protected]">
<input name="success" type="hidden" value="http://www.bbc.co.uk/news/21802237">
<p>
<label for="name">Name:</label>
<input name="email_name" type="text" id="name">
var phantomas = require('phantomas');
var run;
var options = {
"reporter": "tap"
};
console.log('phantomas v%s loaded from %s', phantomas.version, phantomas.path);
run = phantomas('http://pal.live.bbc.co.uk/news', options);
// errors handling
@jcleveley-zz
jcleveley-zz / gist:30816ba79127efd0de66
Created November 10, 2014 11:27
Kick calendar osx
~/Library/Preferences/com.apple.iCal.plist
~/Library/Calendars/Calendar\ Cache
http://ichef.sandbox.dev.bbc.co.uk/news/200/deltaorigin.bbc.co.uk/images/live/p0/2d/6h/p02d6h3j.jpg
http://ichef.sandbox.dev.bbc.co.uk/news/ws/999/amz/worldservice/test/assets/images/2014/02/20/140220143541_pitts_144x81_none_nocredit.jpg
http://ichef.sandbox.dev.bbc.co.uk/news/100/media/images/79171000/jpg/_79171473_79171472.jpg
http://ichef.sandbox.dev.bbc.co.uk/news/200/amz/cps/test/images/media/images/63443000/jpg/_63443281_test_image.jpg
http://ichef.sandbox.dev.bbc.co.uk/news/270/www.stage.bbc.co.uk/media/images/63731000/jpg/_63731540_triggle-464x261.jpg
http://ichef.sandbox.dev.bbc.co.uk/news/highquality/400/media/images/74555000/jpg/_74555451_star_wars_cast_976.jpg
http://ichef.sandbox.dev.bbc.co.uk/news/2048/media/images/79171000/jpg/_79171473_79171472.jpg
@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
@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 / 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 / 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')