Skip to content

Instantly share code, notes, and snippets.

View opentechnologist's full-sized avatar
🏠
Working from home

Mario (BU) Flores Rey II opentechnologist

🏠
Working from home
View GitHub Profile
@opentechnologist
opentechnologist / yield_example.go
Created December 10, 2023 23:07
An example of using goroutine channel synchronization and communication to emulate the yield control statement from popular programming languages.
/*
Copyright © 2013 Mario (BU) Flores Rey CC BY-NC-SA 4.0 DEED
License: https://creativecommons.org/licenses/by-nc-sa/4.0/
Tested on GO v1.2.2
*/
package main
import (
"fmt"
@opentechnologist
opentechnologist / brightness.ps1
Created October 28, 2023 23:21
a simple PowerShell script to adjust the screen display's brightness.
<#
.SYNOPSIS
Adjust screen display brightness.
.DESCRIPTION
This script adjusts the screen display's brightness by accepting
a percentage value between 0 and 100 indicating the strength of
the brightness the screen display's backlight should emit.
@opentechnologist
opentechnologist / noemptydir.ps1
Created July 16, 2023 03:27
a simple PowerShell script to remove annoying empty directories.
<#
.SYNOPSIS
Recursively removes all empty directories.
.DESCRIPTION
This script locally traverses all existing directories starting from
the current directory and then employs a depth first removal of empty
directories.
@opentechnologist
opentechnologist / Deferred.js
Created November 24, 2022 18:46
a Promise-based class that resolves when DOM has finished loading.
/*
A simple Promise-based class that will resolve only after the DOM has completely loaded.
The callback's responsibility is to provide the value when the promise is fulfilled.
It can be used to return classes or objects created by code from deferred script tags.
~Bu
@opentechnologist
opentechnologist / Deferred.js
Last active November 24, 2022 18:49
a Promise-based class that resolves when DOM has finished loading.
/*
A simple Promise-based class that will resolve only after the DOM has completely loaded.
It can be used with or without a callback. But when a callback is supplied, the responsibility
of resolving or rejecting the Promise is passed on to the callback.
~Bu
@opentechnologist
opentechnologist / GoogleMeetPushToTalk.js
Last active November 14, 2022 18:28
a snippet that provides push-to-talk capability during meetings on google meet.
/*
GOOGLE MEET PUSH TO TALK (USING CONTROL KEY)
as soon as a meeting is joined, press F12 to open web developer tools.
select the console tab and copy-and-paste this code and press enter.
close the web developer tools, and use google meet normally.
press-and-hold control key down when talking, release when finished.
*/
javascript: (() => {
const selector = '[aria-label*="microphone"][data-is-muted="%"]';
const pushToTalk = () => ({ key, shiftKey, ctrlKey, altKey }) => {
@opentechnologist
opentechnologist / GoogleChromeDinoGameOverOverride.js
Created October 15, 2020 05:50
a snippet to override the game over method of the offline built-in t-rex game.
/*
source code: https://source.chromium.org/chromium/chromium/src/+/master:components/neterror/resources/offline.js
paste into address bar: chrome://dino/
then before starting game, press F12 to open the Chrome developer console
and then paste this code snippet to override the game's gameOver() method.
enjoy!