Skip to content

Instantly share code, notes, and snippets.

View samuelcotterall's full-sized avatar

Samuel Cotterall samuelcotterall

View GitHub Profile
@samuelcotterall
samuelcotterall / compass-to-docksend.rb
Created April 5, 2013 15:55
Sends Compass’ outputted CSS to Transmit’s Docksend
# compass-to-docksend.rb (https://gist.github.com/samuelcotterall/5320424)
#
# Instructions: Put this at the end of config.rb
# Execute AppleScript inside Ruby. I stole this from here: http://porkrind.org/missives/calling-applescript-from-ruby/
def osascript(script)
system 'osascript', *script.split(/\n/).map { |line| ['-e', line] }.flatten
end
# Send to Transmit

Tweetbot Mute Filters

Football

(?i)(football|soccer|fifa|eufa|footy|goal|free kick|penalty|offside|you blind ref|manchester united|united|man utd|mufc|man city|mcfc|real madrid|fergie|giggs|rooney)

@samuelcotterall
samuelcotterall / infinitescroll.js
Created August 29, 2012 16:10
infinatescroll/masonry
$(window).load(function () {
$('.posts').masonry();
$('.masonryWrap').infinitescroll({
debug: true, // Remove this before going live
navSelector : "div#navigation", // selector for the paged navigation (it will be hidden)
nextSelector : "div#navigation a#nextPage", // selector for the NEXT link (to page 2)
itemSelector : ".entry", // selector for all items you'll retrieve
bufferPx : 10000,
extraScrollPx : 11000,
<div class="toggle">
<p>24 Results</p>
<a href="#">Rating<span></span></a>
</div>
<ul class="stay-list">
<li>
<div>
<h3><a href="http://example.com">Title</a></h3>
<p>From £65.00</p>
@samuelcotterall
samuelcotterall / external-link-check.js
Created August 13, 2012 09:30
External Link Check
@samuelcotterall
samuelcotterall / index.html
Created July 24, 2012 14:52
Adam’s link idea
<script>
var circle = $("a.circle"),
circleOffset = $(circle).offset(),
parent = $(circle).parent('li,p,blockquote'),
parentOffset = $(parent).offset();
// Find position of link
var relativeOffsetTop = parentOffset.top - cirlceOffset.top,
relativeOffsetLeft = parentOffset.left - cirlceOffset.left,;
/*
<div class="tiles">
<div class="a1"></div>
<div class="a2"></div>
<div class="a3"></div>
<div class="a4"></div>
<div class="b1"></div>
<div class="b2"></div>
<div class="b3"></div>
<script type="text/javascript">
<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33284346-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
<div class="ml_10 fl_l stay_info">
<div class="box_380 fl_r gallery" id="hotelGallery_f32c3f2e-800b-4547-8fc1-461099d1470b">
...
</div>
<p><span class="pink_highlight">Hotel</span>Velvet Hotel is a 19 bedroom Bespoke Hotel located on Canal Street, part of
Manchester’s Village. Minutes away from Piccadilly train station, the Northern
Quarter, the exclusive shopping districts and theatres, offering King-rooms,
Balcony Kings overlooking Canal Street and luxury Penthouse Suites.</p>