Skip to content

Instantly share code, notes, and snippets.

// ai2html is a script for Adobe Illustrator that converts your Illustrator document into html and css.
// Copyright (c) 2011-2018 The New York Times Company
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this library except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
<style class="dv201808">
.dv201808-graphic {
clear: both;
margin-bottom: 1.25rem;
margin-top: 1.25rem;
padding-left: .85rem;
padding-right: .85rem;
}
.dv201808-graphic--centered {
@darlacameron
darlacameron / .block
Last active March 2, 2017 02:29
3. Drawing shapes
license: gpl-3.0
height: 240
border: no
@darlacameron
darlacameron / .block
Last active March 2, 2017 20:56
2. Transforming data
license: gpl-3.0
height: 240
border: no
@darlacameron
darlacameron / .block
Last active March 2, 2017 01:44
1. DOM Manipulation
license: gpl-3.0
height: 240
border: no
/** choropleth visualization */
#mo_counties_merge{
polygon-fill: #0080ff;
polygon-opacity: 0.8;
line-color: #FFF;
line-width: 0.5;
line-opacity: 1;
}
#mo_counties_merge [ winner_vote_margin <= 53024] {
function parseDate(date) {
var months = ['Jan.', 'Feb.', 'March', 'April', 'May', 'June', 'July', 'Aug.', 'Sept.', 'Oct.', 'Nov.', 'Dec.'];
// get date (no time)
var justDate = date.split('T');
var dateSplit = justDate[0].split('-');
// format date and year
var newDate = new Date(dateSplit[0],dateSplit[1]-1,dateSplit[2]),
day = newDate.getDate(),
@darlacameron
darlacameron / gist:eac5a208c315009151d3
Created July 1, 2015 19:53
two-column type with wordpress
<table style="width:100%">
<tbody><tr>
<td style="width: 50%;"><p>Germamy</p></td>
<td><p>Greece</p></td>
</tr>
</tbody></table>
@darlacameron
darlacameron / gist:3813e3cdfa353d45ce37
Created December 1, 2014 17:39
Deprecated features
<p style="background-color:#fff6d2 ; border: 1px solid #DDC45E; font-size:15px; padding:7px 30px; text-align:center; margin:15px 0;">
Note: Google no longer supports the technology that powers this map, which means some features may not work.
</p>
@darlacameron
darlacameron / AP Styles for Moment.js
Created October 22, 2014 17:33
AP Styles for Moment.js
months = [
[1,"Jan."],
[2,"Feb."],
[3,"March"],
[4,"April"],
[5,"May"],
[6,"June"],
[7,"July"],
[8,"Aug."],
[9,"Sept."],