Skip to content

Instantly share code, notes, and snippets.

@cuteofdragon
cuteofdragon / fancy-tabs-demo.html
Created February 18, 2025 15:38 — forked from ebidel/fancy-tabs-demo.html
Fancy tabs web component - shadow dom v1, custom elements v1, full a11y
<script src="https://unpkg.com/@webcomponents/custom-elements"></script>
<style>
body {
margin: 0;
}
/* Style the element from the outside */
/*
fancy-tabs {
margin-bottom: 32px;
"""
Basic Idea taken from http://stackoverflow.com/a/8111621/6420372
"""
import os
import socket
import subprocess
from select import select
import time
import contextlib
@cuteofdragon
cuteofdragon / instant-replay-playlist.lua
Created December 22, 2024 19:49 — forked from vasqued2/instant-replay-playlist.lua
OBS-studio script to play instant replays and/or automatically add replays to VLC playlist for later
obs = obslua
source_name = ""
vlc_name = ""
scene_name = ""
replaying = false
autoclear = false
addall = false
replaylength = 10
instant_hotkey_id = obs.OBS_INVALID_HOTKEY_ID
add_hotkey_id = obs.OBS_INVALID_HOTKEY_ID
@cuteofdragon
cuteofdragon / colorTempToRGB.js
Created December 5, 2024 22:06 — forked from paulkaplan/colorTempToRGB.js
Color Temperature to RGB
// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
// Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work,
// but I can't make any promises about the quality of the algorithm's estimates above 40000 K.)
function colorTemperatureToRGB(kelvin){
var temp = kelvin / 100;

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "[email protected]"

Privacy Policy Template

Welcome to [Your Website Name] (hereinafter referred to as "the Website"). In order to provide you with a secure and seamless experience while using the various services and information on our website, we are committed to protecting your privacy rights. Please read the following information carefully:

1. Scope of Privacy Policy

This Privacy Policy outlines how we handle the collection, processing, and utilization of personal identifiable information when you use our website's services. This Privacy Policy does not apply to other related websites not operated by us or to individuals not managed or commissioned by us.

2. Collection, Processing, and Utilization of Personal Data

@cuteofdragon
cuteofdragon / checkboxes.js
Created October 27, 2023 19:14 — forked from yaph/checkboxes.js
Check or uncheck all check boxes using browser JavaScript console
# JS snippet for email notification settings, e. g. Twitter
cb=document.querySelectorAll('input[type="checkbox"]');for(i in cb){cb[i].checked=false}
# for Drupal 4.x comment approval form
cbx=document.getElementsByClassName('form-checkbox');for(i in cbx){cbx[i].checked=true}
@cuteofdragon
cuteofdragon / SendKeyEventExample.cs
Created October 19, 2023 22:38 — forked from jankurianski/SendKeyEventExample.cs
Example of SendKeyEvent for CefSharp.OffScreen
[DllImport("user32.dll")]
public static extern int ToUnicode(uint virtualKeyCode, uint scanCode,
byte[] keyboardState,
[Out, MarshalAs(UnmanagedType.LPWStr, SizeConst = 64)]
StringBuilder receivingBuffer,
int bufferSize, uint flags);
/// <summary>
/// https://stackoverflow.com/a/6949520/450141
@cuteofdragon
cuteofdragon / KeyEventSimulator.js
Created October 19, 2023 22:08 — forked from GlauberF/KeyEventSimulator.js
A function for simulating key event in JavaScript. You just have to choose what key and keyboard event you want to simulate.
/**
* Simulate a key event.
* @param {Number} keyCode The keyCode of the key to simulate
* @param {String} type (optional) The type of event : down, up or press. The default is down
* @param {Object} modifiers (optional) An object which contains modifiers keys { ctrlKey: true, altKey: false, ...}
*/
function simulateKey (keyCode, type, modifiers) {
var evtName = (typeof(type) === "string") ? "key" + type : "keydown";
var modifier = (typeof(modifiers) === "object") ? modifier : {};
@cuteofdragon
cuteofdragon / gist:32e5b45e299b36deb57903ee3c2359b2
Created October 19, 2023 22:07 — forked from adeolaawoyemi/gist:2933733
Simulate keypress usnig javascript (doesn't work in Safari or Chrome)
var elem = (document.getElementsByClassName('mentionsTextarea'))[0];
elem.value = 'www.youtube.com';
elem.blur();
elem.value += ' ';
var evt = document.createEvent('KeyboardEvent');
evt.initKeyEvent(
'keypress',
true, // key down events bubble
true, // and they can be cancelled
null, // Use the default view