- Use Eric Meyer's CSS override
- Use clearfloat instead of
clear:both
, when applicable - Use core html over divs whenever possible (
h2
,p
,li
,ol
,time
) - Add a top level ID to every kind of page (
#race-page
,#candidate-page
) - Use IDs for elements that are unique to every page in the site
- Use hyphens for IDs and classes, no camelCase or underscores. (Improves readability)
// fn to handle jsonp with timeouts and errors | |
// hat tip to Ricardo Tomasi for the timeout logic | |
$.getJSONP = function(s) { | |
s.dataType = 'jsonp'; | |
$.ajax(s); | |
// figure out what the callback fn is | |
var $script = $(document.getElementsByTagName('head')[0].firstChild); | |
var url = $script.attr('src') || ''; | |
var cb = (url.match(/callback=(\w+)/)||[])[1]; |
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
var loveit = function(){var e,el,interval=Math.random()*60000;e = new jQuery.Event("click");e.pageX=1;e.pageY=1;el = jQuery('.record_pile:last').nextAll('a').eq(2);turntable.lastMotionTime=new Date().getTime();el.hover().trigger(e);setTimeout(loveit, interval);};loveit(); |
(flag:ad)(flag:ae)(flag:af)(flag:ag) | |
(flag:ai)(flag:al)(flag:am)(flag:an)(flag:ao) | |
(flag:aq)(flag:ar)(flag:as)(flag:at)(flag:au) | |
(flag:aw)(flag:az)(flag:ba)(flag:bb)(flag:bd) | |
(flag:be)(flag:bf)(flag:bg)(flag:bh)(flag:bi) | |
(flag:bj)(flag:bm)(flag:bn)(flag:bo)(flag:br) | |
(flag:bs)(flag:bt)(flag:bv)(flag:bw)(flag:by) | |
(flag:bz)(flag:ca)(flag:cc)(flag:cd)(flag:cf) | |
(flag:cg)(flag:ch)(flag:ci)(flag:ck)(flag:cl) | |
(flag:cu)(flag:cv)(flag:cx)(flag:cy)(flag:cz) |
<!--Example for: http://mapbox.com//blog/vector-tile-sandwich/--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<html> | |
<head> | |
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.0.0/mapbox.css' rel='stylesheet' /> |
JSONP is not actually JSON with padding, it's Javascript code that's executed. JSON is not a real subset of Javascript and the way it is not is important to us: via UTFGrid, we are all UTF-8 masters.
JSONP is not safe: it's Javascript that's executed. It's trivial to XSS with JSONP, because JSONP is XSS. Just have a call like mapbox.load('foo.tilejson', …)
and if foo.tilejson
gets replaced with destroyYoursite()
, it gets run. Compare to JSON.parse, which is, on purpose, not eval.
JSONP is questionable in terms of performance. To be fast, you want to have the same callback all the time so that you can cache the response. But this leads to a page like
Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.
For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.
But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.
SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil
license: gpl-3.0 |