Skip to content

Instantly share code, notes, and snippets.

@olekenneth
olekenneth / snowjob.sh
Created December 15, 2023 11:11 — forked from sontek/snowjob.sh
Make your terminal snow
#!/bin/bash
LINES=$(tput lines)
COLUMNS=$(tput cols)
declare -A snowflakes
declare -A lastflakes
clear
blueprint:
name: deCONZ - Tuya TS0044 4-button scene switch
description: Automate your Tuya TS0044 4 button scene switch using deCONZ events.
domain: automation
input:
tuya_ts0044:
name: Tuya TS0044 4 button scene switch
description: Tuya TS0044 4 button scene switch to use
selector:
device:
blueprint:
name: Send actionable notifications when entering a zone for Android
description: 'Send actionable notifications, when an entity changes.
For each action, you can open an URL, an application on the device or load a lovelace
view/dashboard.
If you plan to use a lovelace view the format would be /lovelace/test where test
is replaced by your defined path in the defined view.
[
"0.9b0c2358dd1788",
"0.af22cceb1f7f28",
"0.c42039b4b4c24",
"0.ae4552e29371b",
"0.fed53f3a522fb",
"0.b78e80e1542c6",
"0.39e998bd9bca3",
"0.a5866e4b207788",
"0.598055b163265"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/epoll.h>
var testRandom = function(times, every) {
var i = 0;
var number = 0;
while(times > i) {
if (Math.floor(Math.random() * every) === (every - 1)) {
number++;
}
i++;
}
@olekenneth
olekenneth / Auto save.workflow
Last active January 22, 2016 10:21
A workflow to start autosaving your file while working. Especially useful Adobe Illustrator
on autoSave(program)
if isRunning(program) then
if isFront(program) then
if isModifierKeyPressed() then
delay 0.1
autoSave(program)
else
tell application "System Events" to tell process program
keystroke "s" using command down
end tell
@olekenneth
olekenneth / every-x-visitor.js
Created March 18, 2015 18:11
For every x visitor - test
var testRandom = function(times, every) {
var i = 0;
var number = 0;
while(times > i) {
if (Math.floor(Math.random() * every) === (every - 1)) {
number++;
}
i++;
}