Skip to content

Instantly share code, notes, and snippets.

View kaligrafy's full-sized avatar

Pierre-Léo Bourbonnais kaligrafy

  • Polytechnique Montréal
  • Montreal, Québec, Canada
View GitHub Profile
@kaligrafy
kaligrafy / gist:fd482247bdd77897220e72d323eb5475
Created February 13, 2024 19:49
od_mtl_2023 Person class
import moment from 'moment-business-days';
import _cloneDeep from 'lodash/cloneDeep';
import {
BasePerson,
BasePersonAttributes,
ExtendedPersonAttributes
} from 'evolution-common/lib/services/baseObjects/BasePerson';
import { parseDate } from 'evolution-common/lib/utils/DateUtils';
import { BasePlaceAttributes } from 'evolution-common/lib/services/baseObjects/BasePlace';
import { BaseTripAttributes } from 'evolution-common/lib/services/baseObjects/BaseTrip';
@kaligrafy
kaligrafy / gist:4784e6651b752c63e00e68530153f953
Created April 19, 2021 17:15
Mapping between osm tags and OD survey activities
const mappings = {
craft: {
_default: ['workUsual', 'workNonUsual', 'service', 'other'],
builder: ['workUsual', 'workNonUsual', 'service', 'other'],
construction: ['workUsual', 'workNonUsual', 'service', 'other'],
metal_construction: ['workUsual', 'workNonUsual', 'shopping', 'service', 'other'],
hvac: ['workUsual', 'workNonUsual', 'service', 'other'],
electrician: ['workUsual', 'workNonUsual', 'service', 'other'],
carpenter: ['workUsual', 'workNonUsual', 'shopping', 'service', 'other'],
diff --git a/data/core.yaml b/data/core.yaml
index 8dd516794..254a04bfa 100644
--- a/data/core.yaml
+++ b/data/core.yaml
@@ -179,6 +179,18 @@ en:
annotation: Changed the role of a relation member.
change_tags:
annotation: Changed tags.
+ follow:
+ title: Follow
import { t } from '../util/locale';
import { geoExtent } from '../geo';
import { actionFollow } from '../actions/follow';
import { behaviorOperation } from '../behavior/operation';
import { utilGetAllNodes } from '../util';
export function operationFollow(selectedIDs, context) {
var action = actionFollow(selectedIDs, context.projection);
export function actionFollow(selectedIDs, projection) {
// tgt: target
// src: source
// cnt: count
// idx: index
var getStartNodeId = function(startNodeId, tgtNodes, srcNodes, graph) {
if (startNodeId) {
return startNodeId;
@kaligrafy
kaligrafy / animatedCircleFragment.shader.glsl
Last active October 26, 2018 19:27
Custom mapbox gl js animated circle shader
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
#define PI 3.14159265359
#define TPI 6.28318530718