Skip to content

Instantly share code, notes, and snippets.

View idarek's full-sized avatar

Dariusz Więckiewicz idarek

View GitHub Profile
@idarek
idarek / README.md
Last active December 29, 2025 07:52
Cooking Mode toggle - the best way to keep your screen awake is by using the Web Wake Lock API.

Cooking Mode Toggle

The best way to keep your screen awake is by using the Web Wake Lock API.

To keep this "minimalist," we will use a small script that only runs when the user toggles a button.

SEO and Accessibility Considerations

HTML Semantics: Use a <label> properly associated with the <input type="checkbox"> so screen readers know what the toggle does.

@idarek
idarek / 7-zip-default-extract.reg
Created September 29, 2024 11:01 — forked from zabbarob/7-zip-default-extract.reg
Make 7-Zip extract to folder when double-clicking archives. (based on http://superuser.com/a/447791)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\7-Zip.001\shell]
@="extract"
[HKEY_CLASSES_ROOT\7-Zip.001\shell\extract]
@="Extract to Folder"
[HKEY_CLASSES_ROOT\7-Zip.001\shell\extract\command]
@="\"C:\\Program Files\\7-Zip\\7zG.exe\" x \"%1\" -o*"
[HKEY_CLASSES_ROOT\7-Zip.7z\shell]
# Rewrite polish characters in URL to non-polish
# like /zabłąkany/ to /zablakany/
RewriteEngine On
RewriteRule ^(.*)ą(.*)$ /$1a$2 [L,R=302]
RewriteRule ^(.*)ć(.*)$ /$1c$2 [L,R=302]
RewriteRule ^(.*)ę(.*)$ /$1e$2 [L,R=302]
RewriteRule ^(.*)ł(.*)$ /$1l$2 [L,R=302]
RewriteRule ^(.*)ń(.*)$ /$1n$2 [L,R=302]
RewriteRule ^(.*)ó(.*)$ /$1o$2 [L,R=302]
@idarek
idarek / TeamViewer-15-id-changer-for-mac.py
Last active June 16, 2025 04:10 — forked from STiXzoOR/TeamViewer-15-id-changer-for-mac.py
Teamviewer 15 ID Changer for macOS (Python 3)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# System: macOS 12+
# Version: TeamViewer v15.x.x
# Python: 3.x.x
# Command: sudo python3 TeamViewer-15-id-changer.py
#
import os
@idarek
idarek / TeamViewer-15-30-3-id-changer-for-mac.py
Last active March 7, 2025 11:40
TeamViewer ID changer (works with TV 15.32.3+ and macOS 12.6)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import platform
import random
import re
import string
import sys
/* https://go.tacodewolff.nl/minify */
enScroll=!1,enFdl=!1,extCurrent=void 0,filename=void 0,targetText=void 0,splitOrigin=void 0;const lStor=localStorage,sStor=sessionStorage,doc=document,docEl=document.documentElement,docBody=document.body,docLoc=document.location,w=window,s=screen,nav=navigator||{},extensions=["pdf","xls","xlsx","doc","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpe","mpeg","wmv","mid","midi","mp3","wav","wma"];function a(e,t,n,o){const j="G-XXXXXXXXXX",r=()=>Math.floor(Math.random()*1e9)+1,c=()=>Math.floor(Date.now()/1e3),F=()=>(sStor._p||(sStor._p=r()),sStor._p),E=()=>r()+"."+c(),_=()=>(lStor.cid_v4||(lStor.cid_v4=E()),lStor.cid_v4),m=lStor.getItem("cid_v4"),v=()=>m?void 0:enScroll==!0?void 0:"1",p=()=>(sStor.sid||(sStor.sid=c()),sStor.sid),O=()=>{if(!sStor._ss)return sStor._ss="1",sStor._ss;if(sStor.getItem("_ss")=="1")return void 0},a="1",g=()=>{if(sStor.sct)if(enScroll==!0)return sStor.sct;else x=+sStor.getItem("sct")+ +a,sSto
Dir | Rename-Item –NewName { $_.name –replace “ “,”_” }
Private Sub FieldName_LostFocus()
If Not IsNull(FieldName) Then
With FieldName
.SetFocus
.SelStart = 0
.SelLength = Len(FieldName)
End With
DoCmd.SetWarnings False
RunCommand acCmdSpelling

Forked from kapilhp/linux_on_c100pa.md with my modifications as commentes on the main Gist.

An account of how to create a USB disk that will boot a Linux 4.19 kernel (based off Chrome OS' most recent working kernel) on an Asus C100PA with a Debian ("buster") root file system. This may also work on other veyron-* devices.

Setup USB Disk

In this first step we will create a Chrome OS GPT partition table on USB drive that looks like this:

      start        size    part  contents