Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapsam
mapsam / notes.md
Last active December 10, 2015 20:33
  • Maptime Socials
    • could be every other month or quarter? What about not affiliated to the meeting times
    • not on Wednesdays so we can get more people
    • Christy is willing to take this on
  • Andrew is feeling burnt out, and that's healthy - now that there are three of us
    • who does what and when?

Monthly duties for organizers

  • primary leader per month
@mapsam
mapsam / react.md
Last active December 11, 2015 21:09
Learning React

Starting with the tutorial straight from Facebook: https://facebook.github.io/react/docs/tutorial.html

  • successfully installed with git clone https://github.com/reactjs/react-tutorial.git
  • required npm install
  • successfully started server running node server.js - viewing at localhost:3000
  • my first Ah-ha is that React can essentially be used to consume a custom API and render components via React components. They are not DOM nodes, apparently - React components are their own thing.
  • react-dom (ReactDOM) gives you DOM-specific methods, while react (react native) gives you React methods.
  • nesting components is super awesome, and now starting to click how to pass data down the pipe with this.props
  • linking a JSON data source to the components now. Apparently props are immutable, meaning that if we change one it won't change down the pipe. This means we use this.state, which can be updated by running this.setState() and passing in parameters based off the component's needs.
  • cool
@mapsam
mapsam / california.json
Last active December 14, 2015 18:03
Draw TopoJSON
{"type":"Polygon","coordinates":[[[-120,40.9],[-120,40.72],[-120,40.53],[-120,40.35],[-120,40.17],[-120,39.98],[-120,39.8],[-120,39.62],[-120,39.44],[-120,39.25],[-120,39.07],[-120,39.01],[-120,39],[-119.77,38.84],[-119.53,38.67],[-119.3,38.51],[-119.06,38.35],[-118.83,38.18],[-118.59,38.02],[-118.36,37.85],[-118.13,37.69],[-117.94,37.55],[-117.76,37.42],[-117.58,37.28],[-117.39,37.14],[-117.21,37],[-117.03,36.86],[-116.84,36.73],[-116.66,36.59],[-116.5,36.46],[-116.34,36.34],[-116.18,36.21],[-116.02,36.08],[-115.86,35.96],[-115.7,35.83],[-115.53,35.71],[-115.37,35.58],[-115.19,35.44],[-115,35.29],[-114.81,35.15],[-114.63,35],[-114.63,35],[-114.63,35],[-114.62,34.88],[-114.61,34.87],[-114.59,34.86],[-114.58,34.86],[-114.57,34.84],[-114.56,34.83],[-114.56,34.82],[-114.56,34.79],[-114.54,34.77],[-114.52,34.76],[-114.49,34.75],[-114.43,34.64],[-114.42,34.64],[-114.42,34.63],[-114.42,34.63],[-114.42,34.6],[-114.42,34.6],[-114.41,34.58],[-114.39,34.57],[-114.38,34.56],[-114.38,34.54],[-114.38,34.54],[-114.37,34.5
@mapsam
mapsam / README.md
Created December 14, 2015 19:30
Outer & Inner loop drawings, TopoJSON

This example shows how geometries with inner loops and outer loops build themselves in opposite direction. The outer loop (red) builds clockwise, while the inner loop (blue) builds counter-clockwise. This is important in order to confidently account for negative MultiPolygons instead of separate Polygon features. Here's a good summary of the importance in winding order.

@mapsam
mapsam / README.md
Last active December 18, 2015 01:39
Winding order

This example shows how geometries with inner loops and outer loops build themselves in opposite direction using d3 and a stroke-dashoffset in a .transition() infinite loop. The outer loop (red) builds clockwise, while the inner loop (blue) builds counter-clockwise. This is important in order to confidently account for "holes" in polygons. Here's a good summary of the importance in winding order.

@mapsam
mapsam / pppushitrealgood.md
Last active January 2, 2016 18:21
Push to Maptime Seattle resources

Assumes you have [email protected]:MaptimeSEA/maptimesea.github.io.git cloned on your local machine.

  1. pull down all recent changes from master: git pull origin master
  2. checkout a new branch, git checkout -b BRANCH-NAME
  3. add a new file under _posts/ with the proper date formatted file name YYYY-MM-DD-NAME.markdown
  4. add the proper YAML to the top of the new file (copy paste from another file)
  5. add all the stuff, make changes, do your thing
  6. add file to local git: git add FILE-NAME.markdown
  7. commit file with note: git commit -m 'NOTE ABOUT CHANGES
  8. push changes to new remote branch: git push origin HEAD (actually write the word HEAD in all caps)
@mapsam
mapsam / code.js
Created January 14, 2016 04:51
Gmail Label Runner
// append old log to the new log
Logger.log(Logger.getLog());
function processInbox() {
var threads = GmailApp.getInboxThreads(0, 25);
for (var i = 0; i < threads.length; i++) {
var thread = threads[i];
var messages = thread.getMessages();
// GITHUB
@mapsam
mapsam / README.md
Last active January 25, 2016 20:26
Benchmark: Encoding 1/22/2016

Benchmark numbers from node-mapnik version 3.4.15.

This is a visualization of the encoding benchmarks for the Mapnik implemention of Mapbox Vector Tile specification located here. Hovering on a line will show the file name. Clicking on that line will open a new tab to the data file for inspection or reference.

@mapsam
mapsam / notes.md
Created February 9, 2016 20:12
Writing tests for node-mapnik

Writing tests for node-mapnik

node-mapnik is a Node.js module that binds the functionality of Mapnik to be used via a a JavaScript API.

They key parts

  • Mocha.js is our javascript testing suite that uses a set of functions and "assertions" to ensure the results of our code are as expected.
  • coveralls.io is a great tool that we use to check for coverage of our tests. It runs our tests for us, and is able to see which lines of code are used, and which are not during those tests. If a particular line of code isn't used during the tests, it shows as red, allowing us to write a particular test for that scenario.
  • The /test directory within the repository is where all of our tests are located.
  • make test is the command that runs our tests. This is actually running mocha -R spec