Skip to content

Instantly share code, notes, and snippets.

View LEDThread.ino
#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;
View ESP32.LINKSTATION.md

ESP32.LINKSTATION

linkstation.mp4

What it is and how it works

An All-in-One WiFi cryptomonitor to display cryptocurrency prices and also monitor one of your trades or investments, based on real-time quotes obtained via the freely accessible FTX.com markets API.

As the name suggests the project is focused on Chainlink. However, the code built on top of the Arduino framework is even for beginners easy to customize.

@christianhent
christianhent / truffle_ganache.md
Last active Aug 11, 2021
Ganache & Truffle Console cheat sheet
View truffle_ganache.md

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";

@christianhent
christianhent / map.php
Last active Dec 17, 2017
shows a CartoDB layer with Leaflet
View map.php
<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 / map.php
Last active Dec 16, 2017
includes Font-Awesome from CDN
View map.php
<?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 Dec 16, 2017
creates the zoomhome-control and add it to the map
View map.php
<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 Dec 16, 2017
disables the standard zoom control
View map.php
<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 Dec 16, 2017
includes the relevant JS and CSS references into your layout
View map.php
<?php
// CSS, goes directly below leaflet.css
$doc->addStyleSheet('media/plg_content_zatracks/css/leaflet.zoomhome.css');
// JS, goes directly below leaflet.js
$doc->addScript('media/plg_content_zatracks/js/leaflet.zoomhome.min.js');
?>
View map.php
<script>
// ... existing map code
// ...
// ... your markers code goes here
document.addEventListener("DOMContentLoaded", function(event){
var container = document.getElementById("wpts");
if (typeof(container) != 'undefined' && container != null){
var wpts = document.getElementById("wpts").children;
var string = null;
var title = null;
@christianhent
christianhent / joomla article, markers content
Created Dec 15, 2017
joomla article, map markers for zatracks
View joomla article, markers content
<ul id="wpts" hidden>
<li title="Wöhrder Wiese">49.450647,11.0866813</li>
<li title="Wasserwerk Erlenstegen">49.472041,11.1398093</li>
<li title="Brücke am Pulversee">49.458071,11.1097983</li>
</ul>