Skip to content

Instantly share code, notes, and snippets.

View IvanSanchez's full-sized avatar
🔥
Burnt out, cooling down

Iván Sánchez Ortega IvanSanchez

🔥
Burnt out, cooling down
View GitHub Profile
cameras:
camera1:
type: perspective
lights:
light1:
type: directional
direction: [0, 1, -.5]
diffuse: .3
ambient: 1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/* eslint indent:[2, "tab", {"VariableDeclarator": 0}], no-mixed-spaces-and-tabs:[2, "smart-tabs"] */
// Code snipped from https://github.com/Leaflet/Leaflet/blob/master/src/layer/Layer.js
L.Layer = L.Evented.extend({
_updateZoomLevels: function () {
var minZoom = Infinity,
maxZoom = -Infinity,
oldZoomSpan = this._getZoomSpan();
var noble = require('noble');
noble.on('stateChange', (state)=>{
console.log(state);
if (state === 'poweredOn') {
noble.startScanning();
} else {
noble.stopScanning();
}
@IvanSanchez
IvanSanchez / log-rtt.js
Created February 13, 2018 14:10
RTT logging
const jprog = require('pc-nrfjprog-js');
const rtt = jprog.RTT;
const debug = require('debug');
function rttReadLoop(sn, ch, size, log){
rtt.read(ch, size, (err, str)=>{
if (err) {
log(err);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// To run this, visit https://ivansanchez.gitlab.io/gleo/repl.html and copy-paste into there.
import MercatorMap from "gleo/MercatorMap.mjs";
import Geometry from "gleo/geometry/Geometry.mjs";
import epsg4326 from "gleo/crs/epsg4326.mjs";
// Load and enable proj4js:
import proj4 from "proj4js";
import { enableProj } from "gleo/crs/projector.mjs";