- Change Tabs:
option+command+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @fileOverview | |
| * | |
| * Deletes old lambda versions which is useful if the 75gb limit is hit in region | |
| * | |
| * | |
| * Example of running script: | |
| * NODE_ENV=prod AWS_PROFILE=user-profile AWS_REGION=us-west-2 node ./delete-old-lambda-versions.js | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| map.on('click', closeSpideredFeatures); | |
| function closeSpideredFeatures(e) { | |
| if (e.originalEvent.target.className.indexOf('spider') <= -1) { | |
| var mapContainer = e.target._container.id; | |
| unspiderFeatures(mapContainer); | |
| } | |
| } | |
| function unspiderFeatures(mapContainer) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // LEG_LIMIT is a constant we used to enforce how many legs are allowed. If exceeded we zoom the layer in one zoom level. | |
| if (enforceLegLimit && features.length > LEG_LIMIT) { | |
| var currentZoom = map.getZoom(); | |
| map.flyTo({center: options.location, zoom: currentZoom + 1}); | |
| return; | |
| } | |
| spiderifier = new MapboxglSpiderifier(map, { | |
| markerWidth: 40, | |
| markerHeight: 40, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Example of a function for getting all features in a current cluster | |
| var getFeaturesFromCluster = function(mapZoom, sourceId, clusterId){ | |
| var sourceCluster = layerClusters[sourceId]; // Objected holding all superclusters instances keyed off source id | |
| var zoomLevel = Math.floor(mapZoom); // current zoom level | |
| return sourceCluster.getLeaves(clusterId, zoomLevel, Infinity); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var createSuperClusterForLayer = function(sourceId, clusterRadius, data){ | |
| var layerSource = map.getSource(sourceId); | |
| var scale = 8192 / layerSource.tileSize; | |
| var cluster = new supercluster({ | |
| "radius": clusterRadius * scale, | |
| "extent": 8192, | |
| "maxZoom": layerSource.maxzoom - 1 | |
| }); | |
| cluster.loadData(data); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 3.5) | |
| project(know_you) | |
| find_package(OpenCV REQUIRED) | |
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
| set(SOURCE_FILES main.cpp) | |
| add_executable(opencv ${SOURCE_FILES}) | |
| include_directories(${OpenCV_INCLUDE_DIRS}) | |
| target_link_libraries(opencv ${OpenCV_LIBS}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.DirectoryServices.AccountManagement; | |
| using System.Linq; | |
| using System.Security.Claims; | |
| using System.Threading.Tasks; | |
| using Thinktecture.IdentityServer.Core; | |
| using Thinktecture.IdentityServer.Core.Models; | |
| using Thinktecture.IdentityServer.Core.Services; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _settings = { | |
| foo:"test", | |
| bar: "dude" | |
| }; | |
| var createGetters = function(obj){ | |
| var getters = {}; | |
| for (var property in obj) { | |
| if (obj.hasOwnProperty(property)) { | |
| getters['get'+property] = function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "tutorial", | |
| "version": "1.0.0", | |
| "description": "A package file I use when playing around with new client side libraries or ideas", | |
| "main": "", | |
| "scripts": { | |
| "start": "http-server ./ -p 3002 -o --cors" | |
| }, | |
| "author": "J. Nolan Hager", | |
| "license": "MIT", |
NewerOlder