Skip to content

Instantly share code, notes, and snippets.

View leoneckert's full-sized avatar
🕳️

Leon Eckert leoneckert

🕳️
View GitHub Profile
@leoneckert
leoneckert / chrome-kiosk.sh
Created October 28, 2025 06:32
Re-open chrome if window gets closed. Kiosk style
#!/bin/bash
URL="https://google.com"
unclutter & # optional, if you have it on macOS
launch() {
open -na "Google Chrome" --args --kiosk "$URL"
}
chrome_window_exists() {
@leoneckert
leoneckert / script.js
Created December 8, 2021 05:22
timeSyncedEventInterval
function doSomethingSyncedEveryXseconds(x, numStages, callback){
let currentTimeInSeconds = Math.floor(Date.now()/1000);
let stage = Math.floor(currentTimeInSeconds/x)%numStages; //
callback(stage);
let changed = false;
setInterval(function(){
let currentTimeInSeconds = Math.floor(Date.now()/1000);
if(currentTimeInSeconds%x==0&&!changed){
stage = Math.floor(currentTimeInSeconds/x)%numStages; //
callback(stage);
@leoneckert
leoneckert / cnotact-sheet.md
Created July 14, 2020 09:14
contact sheet from video

still from video: mkdir outdir

ffmpeg -r 1 -i invideo.mp4 -r 1 outdir/$filename%04d.jpg
-r 1 ... -r 1 // every frame
-r 2 ... -r 1 // every second frame
-r 4 ... -r 1 // every fourth frame
// etc. probably not the best way :)
@leoneckert
leoneckert / socket.io-1-0-apache-2.4-ssl.conf
Created February 2, 2020 12:50 — forked from iacchus/socket.io-1-0-apache-2.4-ssl.conf
Set reverse proxy websockets in Apache 2.4 using socket.io 1.0. Needs mod_rewrite module, this version uses SSL. As seen here https://serverfault.com/questions/616370/configuring-apache-2-4-mod-proxy-wstunnel-for-socket-io-1-0
<VirtualHost *:80>
ServerName forum.example.com
Redirect permanent / https://forum.example.com
</VirtualHost>
<VirtualHost *:443>
ServerName forum.example.com
@leoneckert
leoneckert / index.html
Created February 19, 2019 13:42
Start of a Javascript Cheat sheet for Applications Lab class
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1 id="headline">This is a dull old html page</h1>
<p id="aboutLife">HTML is all I need<p>
<button id="justAnotherButton">Click here</button>
let friends = [
{
name: "Anna",
age: 27
},
{
name: "Bob",
age: 26
},
{
@leoneckert
leoneckert / map4.js
Last active November 23, 2018 15:49
let friends = [
{
name: "Anna",
age: 27
},
{
name: "Bob",
age: 26
},
{
[
{
"Date": "5/8/2018",
"Time": "10:00 AM",
"Person": "Shelley Hu",
"Project": "The Act of Receiving"
},
{
"Date": "5/8/2018",
"Time": "10:12 AM",
[
{
"project": "The Act of Receiving",
"person": "Shelley Hu",
"date": "07/05/18 19:15:00 "
},
{
"project": "Soundscape: a Tool for Music Makers",
"person": "Dror Ayalon",
"date": "08/05/18 10:12:00 "
@leoneckert
leoneckert / index.html
Created April 9, 2018 23:26
dominant colors
<!--
THIS IS THE LIB WE USE: https://github.com/akfish/node-vibrant/
and the vo=ibrant.js file comes fro a strange place
download "vibrant.3.0.0-alpha.2.zip"
from https://github.com/akfish/node-vibrant/releases
and use vibrant.js or the minified version
-->