Skip to content

Instantly share code, notes, and snippets.

View rickd-uk's full-sized avatar
🏠
Working from home

Rick D rickd-uk

🏠
Working from home
View GitHub Profile
@rickd-uk
rickd-uk / opensource-alternatives.txt
Last active March 16, 2021 11:58
OPENSOURCE ALTERATIVES OF POPULAR SERVICES
ARCHIVE WEB PAGES - ARCHIVE_BOX
https://awesomeopensource.com/project/ArchiveBox/ArchiveBox
https://github.com/ArchiveBox/ArchiveBox
SAVE WEB PAGES - WALLABAG
https://wallabag.org/en#
https://github.com/wallabag
STORE PASSWORDS - LESSPASS
@rickd-uk
rickd-uk / cloudSettings
Last active March 9, 2023 14:00
BASH - MAKE EVAL SAFE
{"lastUpload":"2023-03-09T14:00:32.624Z","extensionVersion":"v3.4.3"}
@rickd-uk
rickd-uk / beautiful_spinner.sh
Created March 15, 2021 02:34
BASH - BEAUTIFUL SPINNER
**COMPLEX SPINNER**
#!/bin/bash
#Shows a spinner while another command is running. Randomly picks one of 12 spinner styles.
#@args command to run (with any parameters) while showing a spinner.
#E.g. ‹spinner sleep 10›
function shutdown() {
tput cnorm # reset cursor
}
trap shutdown EXIT
@rickd-uk
rickd-uk / spinner2.sh
Created March 15, 2021 02:36
BASH SPINNER 2
**ANOTHER SPINNER**
#!/bin/sh
#The command you are waiting on goes between the ( ) here
#The example below returns a non zero return code
(sleep 20 ; /bin/false) &
pid=$! ; i=0
@rickd-uk
rickd-uk / spinner3.sh
Created March 15, 2021 02:36
BASH - SPINNER 3
**ONE MORE SPINNER**
DEFAULT_SpinnerFrames=("—" "\\" "|" "/")
##@function: spinner(action, label, &spinnerFramesRef[])
##
##@description: Perform an action asynchronously and display
##spinner till action is completed
##
##@param action: The action the execute
@rickd-uk
rickd-uk / Error: Route did not complete loading.txt
Created March 23, 2021 00:47
ERRORS - NEXTJS - ROUTE DID NOT COMPLETE LOADING
* Exception: Error: Route did not complete loading: / at _callee$ (webpack-internal:///./node_modules/next/dist/client/route-loader.js:272:113)
at tryCatch (webpack-internal:///./node_modules/regenerator-runtime/runtime.js:63:40) at Generator.invoke [as _invoke]
(webpack-internal:///./node_modules/regenerator-runtime/runtime.js:293:22) at Generator.eval [as next]
(webpack-internal:///./node_modules/regenerator-runtime/runtime.js:118:21) at asyncGeneratorStep
(webpack-internal:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _next
(webpack-internal:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
* message: "Route did not complete loading: /"
stack: "Error: Route did not complete loading: /↵
at _callee$ (webpack-internal:///./node_modules/next/dist/client/route-loader.js:272:113)↵
at tryCatch (webpack-internal:///./node_modules/regenerator-runtime/runtime.js:63:40)↵
at Generator.invoke [as _invoke] (webpack-internal:///./node_modules/regen
@rickd-uk
rickd-uk / random-non-repeating.py
Created February 6, 2022 02:32
Random Non-Repeating
#Whenever an item is selected, move it to the back of the array and randomly select from a slice of the original array array.slice(0, -5).
var a = ["Roger", "Russell", "Clyde", "Egbert", "Clare", "Bobbie", "Simon", "Elizabeth", "Ted", "Caroline"];
var chooseName = function () {
var unique = true;
num = Math.floor(Math.random() * a.length - 5);
name = a.splice(num,1);
a.push(name);
}
@rickd-uk
rickd-uk / delayed-event.js
Created February 6, 2022 02:33
JS - Delayed Event (Mouseover, Mouseout)
function myDelayedThing() {
var mySelectors = document.querySelectorAll('.something');
// Loop through mySelectors
for(var i = 0; i < menuLinks.length; i++) {
// Add 'open' class on mouseover
menuLinks[i].addEventListener('mouseover', function() {
this.classList.add('open');
@rickd-uk
rickd-uk / core_vim.md
Created February 6, 2022 04:04
CORE_VIM

HIGHLIGHTING

Turn Off
:noh

Turn Off / On
set nohlsearch
@rickd-uk
rickd-uk / ask-user-permission-to-allow-sound.html
Created February 13, 2022 09:58
Ask User Permission To Allow Sound (HTML)
<div class="alert">
<p>This webpage would like to play sounds</p>
<p class="buttons">
<button value="0">Block</button>
<button value="1">Allow</button>
</p>
</div>
<button id="btn">trigger notification</button>