Skip to content

Instantly share code, notes, and snippets.

View honsa's full-sized avatar
💭
I am just a human

honsa.ch honsa

💭
I am just a human
View GitHub Profile
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
body {
background: repeat url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/7QCIUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAGscAVoAAxslRxwCAAACAAAcAnQAV8KpIENoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbGQgLSBodHRwOi8vd3d3LnJlZGJ1YmJsZS5jb20vcGVvcGxlL0NoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAA
@honsa
honsa / wallabag_auto_tag_rule-trigger.mysql
Last active October 2, 2018 18:33
Automaticly create rules for new tags in wallabag MySQL database. Search in title and content for keyword and trigger wallabag_tagging_rule insert with this keyword.
BEGIN
SET @tag = NEW.slug;
If length(@tag) >= 3 THEN
SET @ruleTitle = CONCAT('title matches " ', @tag,' "');
SET @ruleContent = CONCAT('content matches " ',@tag,' "');
INSERT INTO wallabag_tagging_rule (config_id,rule,tags) VALUES (1,@ruleTitle, @tag);
INSERT INTO wallabag_tagging_rule (config_id,rule,tags) VALUES (1,@ruleContent, @tag);
END IF;
END
@honsa
honsa / chat-frontend.js
Created November 22, 2018 20:08 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@honsa
honsa / js-observables-binding.md
Created February 7, 2019 19:52 — forked from austinhyde/js-observables-binding.md
Vanilla JavaScript Data Binding

Observables

You don't really need a framework or fancy cutting-edge JavaScript features to do two-way data binding. Let's start basic - first and foremost, you need a way to tell when data changes. Traditionally, this is done via an Observer pattern, but a full-blown implementation of that is a little clunky for nice, lightweight JavaScript. So, if native getters/setters are out, the only mechanism we have are accessors:

var n = 5;
function getN() { return n; }
function setN(newN) { n = newN; }

console.log(getN()); // 5

setN(10);

@honsa
honsa / xampp_php7_xdebug.md
Created March 1, 2019 08:58 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup

@honsa
honsa / Saitek X52 Pro Flight Control System - Windows.joy
Created April 18, 2020 10:26 — forked from rafaelmartins/Saitek X52 Pro Flight Control System - Windows.joy
Saitek X52 Pro settings for X-Plane 11 (Windows) - Just download this file to 'X-Plane 11/Resources/joystick configs'
I
1100 version
JOY
OS: Windows
Name: Saitek X52 Pro Flight Control System
Display: Saitek X52 Pro
Assignments:
--------------------------------------------------------------
@honsa
honsa / native_js_drag_and_drop_helper.js
Created August 18, 2020 13:18 — forked from druska/native_js_drag_and_drop_helper.js
Create the `simulateDragDrop` function which can be used to simulate clicking and dragging one DOM Node onto another
function simulateDragDrop(sourceNode, destinationNode) {
var EVENT_TYPES = {
DRAG_END: 'dragend',
DRAG_START: 'dragstart',
DROP: 'drop'
}
function createCustomEvent(type) {
var event = new CustomEvent("CustomEvent")
event.initCustomEvent(type, true, true, null)
@honsa
honsa / install-chrome-headless.sh
Created August 26, 2020 12:44 — forked from ipepe/install-chrome-headless.sh
Installing headless chrome on Ubuntu.
#!/bin/bash
# from https://chromium.woolyss.com/
# and https://gist.github.com/addyosmani/5336747
# and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:canonical-chromium-builds/stage
sudo apt-get update
sudo apt-get install chromium-browser
chromium-browser --headless --no-sandbox http://example.org/
@honsa
honsa / css-animation-walking-man.markdown
Created September 6, 2020 06:37
CSS animation (walking man)

CSS animation (walking man)

Bernard Bernoulli (The Day of the Tentacle) walking with CSS animations over Monkey Island background, using CSS3 steps() and audio HTML5 (add autoplay to audio tag for play sound).

Forked from Manz's Pen Monkey Island CSS Animation.

A Pen by honsa on CodePen.

License.

@honsa
honsa / light-shader.shader
Created October 11, 2020 11:02 — forked from hiulit/light-shader.shader
Godot 3 light interact with shader
shader_type canvas_item;
uniform vec4 dawn_color : hint_color = vec4(0.86, 0.70, 0.70, 1.0);
uniform vec4 day_color : hint_color = vec4(1.0, 1.0, 1.0, 1.0);
uniform vec4 dusk_color : hint_color = vec4(0.59, 0.66, 0.78, 1.0);
uniform vec4 night_color : hint_color = vec4(0.07, 0.09, 0.38, 1.0);
uniform float brightness : hint_range(0.0, 10.0, 0.01) = 1.0;
uniform float contrast : hint_range(0.0, 10.0, 0.01) = 1.0;
uniform float saturation : hint_range(0.0, 10.0, 0.01) = 1.0;