Skip to content

Instantly share code, notes, and snippets.

View Donkfather's full-sized avatar
🏠
Working from home

Tudor Popescu Donkfather

🏠
Working from home
View GitHub Profile
@Donkfather
Donkfather / gist:06b6a8d584abcaeda471717469af19fe
Created January 13, 2024 13:45
shelly_1plus_pump_control
let debounceTimer
Shelly.addEventHandler(function (event) {
console.log(event.name, event.info.event)
if (event.name === "input" && event.info.event === "toggle") {
let newState = event.info.state
Shelly.call("KVS.GetMany",'*', function(kvs,errc, errm) {
if(errc) {
console.error(errc, errm)
return
}
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate
# message if it wants to stop the commit.
#
# For branches that follow the following naming it [anything]/[project]/[anything]
# or [project]/[anything] it will prepend the project to the commit msg.
#
@Donkfather
Donkfather / problem
Last active September 5, 2018 17:06
<?php
/*
* The problem
* A user can have many and different types of profiles ( Artist, Manager ...)
* Profiles each have a username that should be unique throughout the platform.
* There should be a way to retrieve a profile by username knowing only the username
*
*
*/
@Donkfather
Donkfather / CachesAttributes.php
Created April 2, 2017 20:18
Laravel Eloquent Cacheable Trait
<?php
/**
* Created by PhpStorm.
* User: donkfather
* Date: 02.04.2017
* Time: 23:04
*/
trait CachesAttributes {
@Donkfather
Donkfather / designer.html
Created November 20, 2014 18:40
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="core-slideshow">
<template>
<style>
:host {
position: absolute;
background: white;
width: 100%;