Skip to content

Instantly share code, notes, and snippets.

View adg29's full-sized avatar
📱

Alan Garcia adg29

📱
View GitHub Profile
@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);
@monfera
monfera / .block
Last active August 8, 2016 21:05
circinus
license: gpl-3.0
@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

@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;
@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' />
@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);

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

@kiwanami
kiwanami / calfw-git.el
Last active August 14, 2023 16:27
Calendar view for git-log
;;; calfw-git.el --- calendar view for git-log
;; Copyright (C) 2014 SAKURAI Masashi
;; Author: SAKURAI Masashi <m.sakurai at kiwanami.net>
;; Keywords: calendar
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@amrit
amrit / README.md
Last active August 29, 2015 14:13
US State Emissions Choropleth

US State Emissions Choropleth

@benshimmin
benshimmin / pathformer.js
Last active January 24, 2024 06:54
Turn Vivus' pathformer into a tiny CLI utility

You need Node, obviously, and JSDom. Then use it like this:

$ ./pathformer.js test.svg > test.out.svg