Skip to content

Instantly share code, notes, and snippets.

View c1sc0's full-sized avatar
🥝
bewi

Krisztian Somogyi c1sc0

🥝
bewi
View GitHub Profile
@c1sc0
c1sc0 / button.ino
Created March 4, 2023 20:38 — forked from phnahes/button.ino
ESP32 button with debounce and no repeat pressed while hold button
volatile unsigned long DebounceTimer;
volatile int ButtonPressed;
volatile unsigned int delayTime = 200;
volatile unsigned int delayRepeatTime = 500;
volatile byte state = LOW;
unsigned long lastInterrupt;
#define pin 34
#define ledPin 2
@c1sc0
c1sc0 / PiCluster-1586518792687.json
Created May 28, 2022 17:59 — forked from dinofizz/PiCluster-1586518792687.json
A Grafana dashboard using Prometheus (with node_exporter and rpi_exporter) to present some basic measurements
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"Kestrel": {
"Endpoints": {
@c1sc0
c1sc0 / curl.md
Created January 25, 2022 17:43 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@c1sc0
c1sc0 / test
Created January 19, 2021 11:04
<img src="file:///\\.\globalroot\device\condrv\kernelconnect">
@c1sc0
c1sc0 / vpn_namespace.md
Created May 1, 2020 20:00 — forked from EnigmaCurry/vpn_namespace.md
OpenVPN and browser specific network routing with ip netns

OpenVPN and browser specific network routing with ip netns

Create network bridge

A network bridge allows us to have a virtual router that we can plug multiple network interfaces into. The IP address is assigned to the bridge rather than the individual network interface.

Create the bridge device, br0 :

@c1sc0
c1sc0 / FactoryPatternImplementation.cs
Created October 12, 2019 13:31 — forked from rohit-lakhanpal/FactoryPatternImplementation.cs
Patterns - Factory Pattern (Real World Example): Provides an interface for creating families of related or dependent objects without specifying their concrete classes.
using System;
using System.Collections.Generic;
namespace DesignPatterns.Factory.RealWorld
{
/// <summary>
/// MainApp startup class for Real-World
/// Factory Method Design Pattern.
/// </summary>
class MainApp
var versionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
document.getElementById("inputfield").addEventListener("keydown", function() { var key = event.keyCode || event.charCode; if(key == 32) {
var wordContainer = document.getElementById("row1");
var descendents = wordContainer.getElementsByTagName('*');
var characterCount = 0;
for(var i = 0; i < descendents.length; i++)
{
var element = descendents[i];
@c1sc0
c1sc0 / main.c
Created September 11, 2018 21:07 — forked from AnttiNykanen/main.c
STM32F103C8 USART example
#include "stm32f10x.h"
#include "stm32f10x_conf.h"
int main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
USART_InitTypeDef USART_InitStructure;
uint16_t rxbuf[64];
int rxbuf_pos = 0;