Skip to content

Instantly share code, notes, and snippets.

@christianhent
christianhent / map.php
Last active December 16, 2017 05:43
disables the standard zoom control
<script>
// ... existing map code
// ...
// set {zoomControl: false} to disable the default zoom control
var map = new L.Map('map',{
fullscreenControl: true,
zoomControl: false,
fullscreenControlOptions: {
position: 'topleft'
},
@christianhent
christianhent / map.php
Last active December 16, 2017 05:47
creates the zoomhome-control and add it to the map
<script>
// ... existing map code
// ...
map.fitBounds(geoJson.getBounds());
// create the zoomhome-control and add it to the map
var zoomHome = L.Control.zoomHome();
zoomHome.addTo(map);
</script>
@christianhent
christianhent / map.php
Last active December 16, 2017 06:06
includes Font-Awesome from CDN
<?php
// includes Font-Awesome, goes directly above leaflet.css
$doc->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
?>
@christianhent
christianhent / map.php
Last active December 17, 2017 04:48
shows a CartoDB layer with Leaflet
<script>
//
var tile = new L.TileLayer('http://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> ' +
'contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">' +
'CC-BY-SA</a>. Tiles &copy; <a href="http://carto.com/">' +
'CARTO</a>'
});
</script>
@christianhent
christianhent / truffle_ganache.md
Last active August 11, 2021 11:29
Ganache & Truffle Console cheat sheet

Ganache & Truffle Console cheat sheet

ERC20 Token contract

YourToken.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

import "@openzeppelin/contracts/access/Ownable.sol";

ESP32.LINKSTATION 2

linkstation.mp4

What it is and how it works

An ESP32 WiFi cryptomonitor to display cryptocurrency prices based on quotes obtained via cryptocompare.com API. The code built on top of the Arduino framework is even for beginners easy to customize.

#include <Thread.h>
int pwmPins[] = {3, 5, 6, 9, 10, 11};
int pwmCount = 6;
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
int ioPins[] = {1, 0, A5, A4, A3, A2, A1, A0, 2, 4, 7, 8, 12, 13};
int ioCount = 14;
int chaseDirection = 1;