Skip to content

Instantly share code, notes, and snippets.

View kevinmarks's full-sized avatar

Kevin Marks kevinmarks

View GitHub Profile
@kevinmarks
kevinmarks / savant.js
Last active March 27, 2016 05:37
Genius.it escape hatch
var loc = window.location.href;
if (loc.includes('genius.it')) {
offset = loc.indexOf('genius.it');
newloc = loc.slice(0,offset)+ loc.slice(offset+'genius.it/'.length);
window.location.replace(newloc);
}
@kevinmarks
kevinmarks / guardianstoryexamplemf2parsed.json
Last active October 17, 2015 01:45
Microformats parsed version of the Guardian stories example
{
"rels": {},
"items": [
{
"type": [
"h-entry"
],
"properties": {
"url": [
"http://www.theguardian.com/technology/audio/2015/oct/16/esports-tech-updog-podcast"
@kevinmarks
kevinmarks / guardianstoryexamplemf2min.html
Last active October 17, 2015 01:44
Minimal Guardian Story example with microformats
<ul class="storycards">
<li class="card">
<div class="h-entry">
<a href="http://www.theguardian.com/technology/audio/2015/oct/16/esports-tech-updog-podcast">
<img class="u-featured" src="https://i.guim.co.uk/img/static/sys-images/Guardian/Pix/pictures/2015/8/13/1439457219532/a7aadab7-1e60-4d5e-92d8-e057c5842b35-620x372.jpeg?w=220&amp;q=85&amp;auto=format&amp;sharp=10&amp;s=3417f13ed4cc4e832ba7cd9c6e973b82">
<h3 class="p-name">Why are esports so popular?</h3></a>
<p class="p-summary">League of Legends is coming to Wembley. The BBC is broadcasting it. Sky is taking bets on it. But does esports even care what the mainstream thinks?</p>
<time class="dt-published" datetime="2015-10-16T16:00:00+0000"></time>
</div>
</li>
@kevinmarks
kevinmarks / guardianstoryexamplemf2.html
Last active October 16, 2015 23:26
The same guardian story previews, as https://gist.github.com/kevinmarks/69e0d5083204f0dfb411 marked up with microformats 2
<div class="fc-slice-wrapper">
<ul class="u-unstyled l-row l-row--cols-4 fc-slice fc-slice--q-q-q-q">
<li class="fc-slice__item l-row__item l-row__item--span-1 u-faux-block-link">
@kevinmarks
kevinmarks / guardianstoryexampleraw.html
Last active October 16, 2015 22:55
The html for the story cards taken directly from the Guardian website footer for http://www.theguardian.com/technology/audio/2015/oct/16/ad-blocking-free-content-tech-podcast
<div class="fc-slice-wrapper">
<ul class="u-unstyled l-row l-row--cols-4 fc-slice fc-slice--q-q-q-q">
<li class="fc-slice__item l-row__item l-row__item--span-1 u-faux-block-link">
def unknown_starttag(self, tag, attrs):
# called for each start tag
# attrs is a list of (attr, value) tuples
# e.g. for <pre class='screen'>, tag='pre', attrs=[('class', 'screen')]
if _debug: sys.stderr.write('_BaseHTMLProcessor, unknown_starttag, tag=%s\n' % tag)
uattrs = []
strattrs=''
if attrs:
for key, value in attrs:
value=value.replace('>','&gt;').replace('<','&lt;').replace('"','&quot;')
@kevinmarks
kevinmarks / dabblet.css
Last active August 29, 2015 14:24
dl to flex tabs
/**
* dl to flex tabs
*/
dl {display:flex; flex-wrap: wrap; justify-content: space-around; align-items:center;}
dt {order:1; flex-grow:1; padding:10px; font-family:sans-serif; background:#eee; border-left:10px solid #ccc;}
dt:first-child { background:white;}
dd:target {visibility:visible;}
dd {order:2; width:100%; flex-basis:auto; visibility:hidden; height:0;}
@kevinmarks
kevinmarks / dabblet.css
Last active August 29, 2015 14:24
dl to flex tabs
/**
* dl to flex tabs
*/
dl {display:flex; flex-wrap: wrap; justify-content: space-around; align-items:center;}
dt {order:1; flex-grow:1; }
dt:first-child { background:yellow;}
dd {order:2; width:100%; flex-basis:auto; background:aliceblue;}
@kevinmarks
kevinmarks / dabblet.css
Created July 2, 2015 17:41
nth of type addressing of microformats
/**
* nth of type addressing of microformats
*/
.h-entry:nth-of-type(3) { color: green;}
min-height: 100%;
@kevinmarks
kevinmarks / dabblet.css
Last active August 29, 2015 14:23
Untitled
<!-- making an indiecard as an iframe -->
body {margin:0; height:100%;}
body { font-family: "Gill Sans", Roboto,Verdana, sans-serif; }.
.indiecard {display:flex; flex-direction: column; margin:0; width:90%; height:90%; padding: 4%; overflow:false;}
h1 {display:flex; flex-direction: row; font-size:20vh;}
h2 {display:flex; flex-direction: row; font-weight: 300;}.
svg {height:100%; width:100%;} text {font-size:20vh;}
a { text-decoration:none;}
p-name { flex-grow:4; max-width:20%;}