Skip to content

Instantly share code, notes, and snippets.

View adg29's full-sized avatar
📱

Alan Garcia adg29

📱
View GitHub Profile

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@dwtkns
dwtkns / lockView.js
Created October 6, 2014 19:32
Lock viewport onto an element during resize
// Looks an element up by CSS selector and keeps it centered in the viewport on window resize
// Useful for testing responsive versions of specific DOM elements
// if jquery isn't loaded on the page, paste this code into the console first to load it:
var jqURL = 'http://code.jquery.com/jquery-latest.min.js';
var jqscript = document.createElement('script');
jqscript.type= 'text/javascript';
jqscript.src = jqURL;
document.head.appendChild(jqscript);
@zross
zross / index.html
Last active April 11, 2024 08:33
Animate path on Leaflet map using D3 (Gimme!, Proletariat)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.css' rel='stylesheet' />
@zanarmstrong
zanarmstrong / d3formatting.css
Last active October 22, 2023 07:29
formatting numbers example
body {
margin: 20px 0px 0px 50px;
}
.formattext {
text-align: right;
}
.formatresult {
text-align: left;
@joyrexus
joyrexus / README.md
Last active July 26, 2018 21:13
Block thumbnail HOWTO

So you're using gistup to create gists (and blocks) from the command line. If not, see this tutorial for a quick overview.

And now you want to add thumbnails to your gists so that your blocks portfolio looks all pretty, right. How?

To have a thumbnail associated with your gist you need to create a 230x120 pixel PNG image file named thumbnail.png and include this at the top-level of your gist's repo (generated by gistup).

The main trick is in finding an appropriate image and then right-sizing it for the 230x120 dimensions that the blocks site expects your thumbnail.png to

@monfera
monfera / .block
Last active August 8, 2016 21:05
circinus
license: gpl-3.0
@fitnr
fitnr / d3.geo.voronoi.js
Last active June 10, 2017 05:41
US Urban Areas Voronoi
(function() {
var π = Math.PI,
degrees = 180 / π,
radians = π / 180,
ε = 1e-15,
circle = d3.geo.circle().angle(90);
d3.geo.voronoi = function(points, triangles) {
if (arguments.length < 2) triangles = d3.geo.delaunay(points);
@mbostock
mbostock / .block
Last active August 5, 2019 23:43
Zoom to Bounding Box II
license: gpl-3.0
redirect: https://observablehq.com/@d3/zoom-to-bounding-box
@sconnelley
sconnelley / index.html
Created March 14, 2014 23:12
Fitting D3 map inside a viewport and constrain panning.
<!DOCTYPE html>
<html lang="en">
<head>
<title>d3 geo map</title>
<meta charset="utf-8">
<style>
svg {
border: 1px solid #ccc;
}
@mbostock
mbostock / .block
Last active July 21, 2019 17:33
Timezones
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/time-zones