Skip to content

Instantly share code, notes, and snippets.

View dandelany's full-sized avatar
🚀
Building software for people who build spaceships

Dan Delany dandelany

🚀
Building software for people who build spaceships
View GitHub Profile
@dandelany
dandelany / materialdesign.less
Created July 8, 2014 19:27
Material Design Colors in LESS
/* colors from Google Material Design
http://www.google.com/design/spec/style/color.html#color-ui-color-palette
*/
@red-50: #fde0dc;
@red-100: #f9bdbb;
@red-200: #f69988;
@red-300: #f36c60;
@red-400: #e84e40;
@red-500: #e51c23;
@dandelany
dandelany / create-flux-client.js
Created November 7, 2014 21:36
Fluxxor flux-client
var Fluxxor = require('fluxxor');
var _ = require('underscore');
// A FluxClient is a special Fluxxor.Store constructor that is a wrapper around a 'client' object.
// Client objects are generally an object containing all the server calls your app can make
// FluxClient allows you to listen for Fluxxor actions and cause them to trigger requests in the client,
// this way your actions can remain pure and don't have to call the client directly.
// It can also dispatch Fluxxor actions when the client request begins and upon request success/failure
// createFluxClient creates a FluxClient constructor from two arguments:
var _ = require('underscore');
var $ = require('jquery');
var d3 = require('d3');
var testData = {
"nodes":[
{"name":"Myriel","group":1},
{"name":"Napoleon","group":1}
],
"links":[
@dandelany
dandelany / main.jsx
Created February 6, 2015 01:18
Marty.js dependsOn test
/** @jsx React.DOM */
var _ = require('lodash'),
React = require('react'),
Marty = require('marty');
var API = {
User: Marty.createStateSource({
type: 'http',
getAll: function() {
return this.get('/').then(function(response) {
shell: {
sayBuiltJs: { command: 'say "built js" -v Cellos' },
sayBuiltLess: { command: 'say "built less" -v Cellos' },
sayCopied: { command: 'say "copied files" -v Cellos' }
}
// InterfaceMixin takes a list of string "interfaces"
// and adds a static called implementsInterface to the component that simply checks if an interface is in the list
// This way, a parent component can pass particular props only to children which implement the relevant interface
// by checking child.type.implementsInterface('SomeInterface')
// usage:
// mixins: [InterfaceMixin('SomeInterface')] // or...
// mixins: [InterfaceMixin(['SomeInterface', 'AnotherInterface'])]
var InterfaceMixin = function(interfaces) {
interfaces = isStr(interfaces) ? [interfaces] : interfaces;
var _ = require('lodash');
var React = require('react/addons');
var Testing = React.createClass({
getInitialState() {
return { count: 0 }
},
onClick() {
this.setState({count: this.state.count+1});
},
@dandelany
dandelany / exactStrict.ts
Created May 21, 2019 00:14
io-ts exactStrict codec
import * as t from 'io-ts';
// --- utils taken from io-ts internals ---
const getIsCodec = <T extends t.Any>(tag: string) => (
codec: t.Any
): codec is T => (codec as any)._tag === tag;
const isInterfaceCodec = getIsCodec<t.InterfaceType<t.Props>>('InterfaceType');
const isPartialCodec = getIsCodec<t.PartialType<t.Props>>('PartialType');
const getPartialTypeName = (inner: string): string => {
@dandelany
dandelany / cnc_maps_process.md
Last active April 13, 2021 09:52
Process for generating CNC maps using QGIS

Data Download

DEM (terrain, raster) data

  • Get DEM files from National Map download tool
  • Set Area of Interest: Selectable Polygon -> Select... -> US State or Territory
    • then click a state on map to select it
  • Or Set Area of Interest: Map Extent/Geometry -> Click Extent -> Draw a rectangle on map
  • After area selected, search for:
    • Elevation Products (3DEP) -> 1/3 arc-second or 1 arc second
{"name":"LandingLMST","trajectory":"I/II","opportunity":"2022","data":[[17.391,17.4416,17.4918,17.5417,17.5916,17.6416,17.6919,17.7426,17.7941,17.8465,17.9002,17.9556,18.0131,18.0731,18.1363,18.2033,18.275,18.3523,18.4361,18.5274,null,null,null,null,null,null,null,null,null,null,null,null,null,16.4942,16.7064,16.876,17.0147,17.1305,17.229,17.314,17.3885,17.4546,17.5138,17.5673,17.6162,17.661,17.7026,17.7412,17.7773,17.8112,17.8433,17.8736,17.9024,17.9299,17.9562,17.9814,18.0055,18.0288,18.0512,18.0729,18.0939,18.1142,18.1339,18.153,18.1716,18.1897,18.2073,18.2245,18.2413,18.2577,18.2738,18.2894,18.3048,18.3198,18.3346,18.349,18.3632,18.3771,18.3908,18.4042,18.4173,18.4303,18.443,18.4555,18.4677,18.4798,18.4916,18.5032,18.5146,18.5258,18.5368,18.5476,18.5581,18.5685,18.5786,18.5885,18.5982,18.6077,18.617,18.6261,18.6349,18.6436,18.652,18.6602,18.6682,18.676,18.6836,18.6909,18.698,18.7048,18.7115,18.7178,18.7239,18.7298,18.7353,18.7406,18.7456,18.7503,18.7547,18.7587,18.7625,18.7659,18.769,18.7717,18.774,18.776