Skip to content

Instantly share code, notes, and snippets.

View piretek's full-sized avatar

Piotr Czarnecki piretek

View GitHub Profile
@piretek
piretek / pesel-exception.php
Created September 29, 2020 09:46
Klasa walidująca i wybierająca informacje nt. PESELu
<?php
/**
* PESEL Exception class
*
* Exception to be thrown when the pesel validation hits failure.
* @author Piotr Czarnecki <piretek@piretek.pro>
* @version 1.0
*/
class PESEL_Exception extends Exception { }
@piretek
piretek / test.yml
Created January 24, 2023 09:49
MyDevil Deployment config file
deployments:
test:
domain: test.example.com
type: php
ssh:
host: sXX.mydevil.net
user: example
key: <filepath to ssh privkey>
port: 22
{
"$ref": "#/definitions/no-code-schema",
"definitions": {
"rootBuildingBlock": {
"type": "object",
"properties": {
"blockType": {
"type": "string",
"const": "ROOT"
},
@piretek
piretek / index.ts
Created March 28, 2024 12:50
Simple Typescript implementation of WLED API using DDP protocol
// Usage of WLEDDdp class
const targetHost = 'xxx.xxx.xxx.xxx';
const targetPort = 4048;
const socket = new WLEDDdp(targetHost, targetPort);
// Lights all diodes white
const rgbValues: Led[] = socket.getLeds([255,255,255]);
socket.send(rgbValues);