Skip to content

Instantly share code, notes, and snippets.

View kevinmarks's full-sized avatar

Kevin Marks kevinmarks

View GitHub Profile
@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 / 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 / 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 / dabblet.css
Created February 22, 2013 19:49
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
#fp transform: rotate(45);
@kevinmarks
kevinmarks / dabblet.css
Created May 6, 2013 08:54
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@keyframes spinme {
from { transform: perspective(400px) rotateY(0deg) }
to { width: perspective(400px) rotateY(360deg) } }
@kevinmarks
kevinmarks / dabblet.css
Created May 6, 2013 08:35
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
.fp {
-webkit-transform: scale(6,.5);
}
@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 / gist:f74137c9c5ceb55c173134a8ac7563fc
Last active November 20, 2016 22:50
Tweets recovered from noterlive logs
#nodevember @leeb: is going to give us a talk on how we think about architecture, not just code. "Architecture is a metaphor"
#nodevember @leeb: Architecture originates from studying the arch, an infinitely composable shape that allows us to build amazing things.
#nodevember @leeb: Pollios tells us architecture has: 1) Firmitas - durability 2) Utilitas - Suitable for purposes 3) Venustas - beauty
#nodevember @leeb: Architecture is about making fundamental structural choices. In software, we choose the elements of abstraction.
#nodevember @leeb: The problem of software architecture is trying to figure out what changed. So we try to add things that...change more?
#nodevember @leeb: When models and views have to listen to each other, there is cascading problems and syncing.
#nodevember @leeb: While REST helped us model our data in terms of a network service, it fails when we rely on other data.
#nodevember @leeb: If we tightly control what can change in the first place, immutability gives us new principl
<?xml version="1.0" ?>
<svg height="600" width="600" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs >
<g id="l0">
<rect width="600" height="600" fill="black"/>
</g>
<g id="l1">
<use xlink:href="#l0" transform="translate(0,0) scale(0.3333333333333333)"/>
<use xlink:href="#l0" transform="translate(200,0) scale(0.3333333333333333)"/>
<use xlink:href="#l0" transform="translate(0,200) scale(0.3333333333333333)"/>
@kevinmarks
kevinmarks / diffdata.js
Last active December 26, 2018 16:52
Diff data stripped - compare objects and show only the inner bits that differ
function diffdatastripped(legacy,shiny) {
let delta={},allgood=true;
for (const key in legacy){
const oldval = legacy[key];
const newval = shiny[key];
if (typeof(oldval)==='object' && typeof(newval)==='object'){
delta[key] = diffdatastripped(oldval,newval)
if (delta[key] !="✅") {
allgood=false;
}