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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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);
var noble = require('noble');
noble.on('stateChange', (state)=>{
console.log(state);
if (state === 'poweredOn') {
noble.startScanning();
} else {
noble.stopScanning();
}
/* 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();
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
cameras:
camera1:
type: perspective
lights:
light1:
type: directional
direction: [0, 1, -.5]
diffuse: .3
ambient: 1
describe("Map.Drag", function () {
describe("#addHook", function () {
it("calls the map with dragging enabled", function () {
var container = document.createElement('div');
var map = new L.Map(container, {
dragging: true
});
expect(map.dragging.enabled()).to.be(true);
map.setView([0, 0], 0);
layout title description author authorsite
post
Announcing Leaflet 1.0-rc1
Leaflet 1.0 Release Candidate 1 ready
Iván Sánchez

The road to Leaflet 1.0 continues - we're proud to get the first release candidate for 1.0 into the wild.

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
<script>
// Trick Leaflet into believing we have a touchscreen (for Chrome)
if (window.Touch) { window.ontouchstart = function(){} };
</script>
describe("Map.Drag", function () {
describe("#addHook", function () {
it("calls the map with dragging enabled", function () {
var container = document.createElement('div');
var map = new L.Map(container, {
dragging: true
});
expect(map.dragging.enabled()).to.be(true);
map.setView([0, 0], 0);