Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Doiron mapmeld

View GitHub Profile
@mapmeld
mapmeld / VectorTiler.js
Last active Aug 29, 2015
Vector tiles that hide undersized features
View VectorTiler.js
// Load data tiles from an AJAX data source
L.TileLayer.Ajax = L.TileLayer.extend({
_requests: [],
_addTile: function (tilePoint) {
var tile = { datum: null, processed: false };
this._tiles[tilePoint.x + ':' + tilePoint.y] = tile;
this._loadTile(tile, tilePoint);
},
// XMLHttpRequest handler; closure over the XHR object, the layer, and the tile
_xhrHandler: function (req, layer, tile, tilePoint) {
@mapmeld
mapmeld / metaphysical-fears.md
Created Mar 17, 2014
metaphysical-fears.md
View metaphysical-fears.md

A recent episode of "Revolution" covered one of my fears: being tricked into solving a code problem through a dream.

After I watched "Inception" it was clear to me that the real value wouldn't be tricking an executive into revealing some small memorized thing, or even introducing an idea. No way! A skilled consultant costs hundreds of dollars an hour. Because time is accelerated in the dream, you could get days of work out of a consultant, overnight. Ideally there would be a friendly agreement between the consultant and the business, and there would be a light workload and luxurious benefits at no cost. But I could easily see it turning into a sweatshop condition, or an intense training simulation, or like in Revolution/Inception the dream challenge could be dumped on you.

So that's one of my metaphysical fears. Here are some more equally illogical, but nasty ones:

  • slipping into an alternative universe where programming is completely different. JavaScript became the language of the web through a complex
@mapmeld
mapmeld / days_in_month.rb
Created May 23, 2014
My current internal process to calculate the number of days in a month
View days_in_month.rb
def days_in_month(month, year=Time.now.year)
if month[:holidays].include?('Halloween')
31
elsif month[:holidays].include?('New Year\'s Eve')
31
elsif month[:name] == 'February'
if year % 4 == 0
if year % 100 == 0 && year % 400 != 0
28
else
@mapmeld
mapmeld / rotary.c
Last active Aug 29, 2015
Annie's Rotary Phone
View rotary.c
/*
RotaryPhone.pde
- Put 3.3V power into the rotary phone
- Connect counter for dial to the Analog 0 pin
- Connect last-counter for dial to the Analog 2 pin
- Connect hangup / pickup to the Analog 5 pin
- setup() runs in the beginning
- loop() repeats every 30ms
--- inside the loop: read the Analog 5 pin (for hang up / pick up)
@mapmeld
mapmeld / protest.md
Last active Aug 29, 2015
Protest Technology
View protest.md

Since college, I have been involved in protests against the Iraq War, G-20 Summit in Pittsburgh (where I witnessed the LRAD sonic weapon used), a potential war against Syria, and warrantless wiretapping. There are many takeaways from protesting, especially how normal it is to be involved, and how essential it is to speak out loud and make demands.

Not everything is going to come true because someone spoke out, because you marched, because the paper publishes a photo of injustice. But peaceful assembly and free press are huge components of our democratic process, the core of so many successful changes in our country. I think a lot of people see protestors as extreme. My brother once asked me, "how can someone ask for $15 an hour to work at McDonalds?" and I said, "If he asked for $12 he'd never get it." A protest establishes that not only is the status quo unacceptable, but that you want a changed world.


How can we help peaceful protestors? How can we make a technology group or fellowship that ai

@mapmeld
mapmeld / fix-newmunimetro.md
Last active Aug 29, 2015
Fix NewMuniMetro.com
View fix-newmunimetro.md

Update: it worked! https://twitter.com/Nextransit/status/552355123570434048

Hey fellow transit hackers,

I'm Nick Doiron (@mapmeld), a 2012 Code for America fellow and one of the devs behind Chicago's transit future map at http://vision.transitfuture.org/

Like you, we had a lot of cool visualization stuff which didn't work on mobile. There are also a few places on your site where the text is wider than the viewport, or scrolling laterally jumbles things up. Fortunately, it looks like there are a few lines of HTML and CSS which will get this thing fixed. If only designing transit networks were so easy!

HTML: replace your current viewport tag. Make this thing a fixed-width single column site.

@mapmeld
mapmeld / to-hack.md
Last active Aug 29, 2015
hacking wishlist
View to-hack.md
@mapmeld
mapmeld / Ωpm.md
Last active Aug 29, 2015
Ωpm project
View Ωpm.md

Ωpm project

Ωpm ("omega package manager") is an encrypted package manager with verifiable builds.

Concept

npm and other package managers have been criticized for including post-install scripts. Some packages (for example, C++ code in a Node package) differ depending on which machine builds them. For cryptography to be trusted, the web needs to embrace verifiable builds. These are also called "deterministic" or "reproducible" builds.

How can I use it?

@mapmeld
mapmeld / transcript.md
Last active Aug 29, 2015
Transcript of my !!con talk by Stanley Sakai
View transcript.md

Typed by Stanley Sakai - @stanographer on twitter and available for hire

JULIA: Next up we're going to have Nick who's going to push us from paradise, adding a remote island alphabet to Wikipedia.

NICK: Can you hear me okay? All right. Can you hear me all right again? All right. Thanks. Thanks for waiting for that.

Hi, my name is Nick Doiron and in real life I work for the Museum of Modern Art but I've done some other projects and this is some crazy project that I've gotten involved in for one laptop for child.

So I got started with this group, the Ministry of Education for the Marshall Islands. So Majuro Atoll is this group way out in Pacific, if you go from California to Hawaii and then out that distance again, you get there. And you get there, and it's this spaghetti string of land out in the middle of the Pacific and it's this island paradise. And at the same time this bizarre thing of nature which, I don't know enough about geology to tell you how this could exist but it definitely does ex

View mimutest.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.