This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extractDataFrom(element) { | |
return (options) => { | |
let data = {} | |
options.forEach(option => { | |
const targetElem = element.querySelector(option.selector); | |
let targetValue; | |
switch (option.attribute) { | |
case 'text': | |
targetValue = targetElem ? targetElem.innerText.trim() : ''; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Function to find the pagination element on a webpage | |
with reasonable accuracy. | |
*/ | |
function findPagination() { | |
const pagElem = | |
Array.from(document.querySelectorAll('body *')) | |
.filter(el => el.nodeType === 1 && el.nodeName !== 'SCRIPT') | |
.filter(el => el.innerHTML.match(/>[\t\n\r\s]*\d[\t\n\r\s]*</g) !== null ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
async function recurseDir (dirPath) { | |
const dir = await fs.promises.opendir(dirPath); | |
const allPaths = []; | |
for await (const dirent of dir) { | |
if (dirent.isDirectory()) { | |
const childPaths = await recurseDir(path.join(dirPath, dirent.name)) | |
childPaths.map(p => allPaths.push(p)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# write first, edit later | |
# toggles the function of the backspace key between | |
# its normal function and that of the delete key | |
# Keycode might be different for other keyboards! | |
# to find the right keycode on your hardware use: | |
# xev -event keyboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// handy wordlist from https://www.oxfordlearnersdictionaries.com/wordlists/oxford3000-5000 | |
// copy is a copy to clipboard helper in browser devtools | |
copy(Array.from(document.querySelectorAll('#wordlistsContentPanel .top-g li')).map(li => { | |
const { hw, ox5000 } = li.dataset; | |
return { word: hw, level: ox5000, type: li.querySelector('span').innerText }; | |
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "fixing permissions for ssh" | |
# rwx --- --- | |
chmod 700 $HOME/.ssh | |
# if it is not a public key, -rw --- --- (inc. conf, auth_hosts) | |
find $HOME/.ssh -type f ! -name "*.pub" -print0 | xargs -0 chmod 600 | |
# -rw r-- r-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list has not been checked manually for duplicates and spelling mistakes. | |
a | |
aback | |
abaft | |
abandoned | |
abashed | |
abdominal | |
aberrant | |
abhorrent | |
abiding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* blingbling.js */ | |
window.$ = document.querySelector.bind(document); | |
window.$$ = document.querySelectorAll.bind(document); | |
HTMLElement.prototype.$ = function (selector) { | |
return this.querySelector(selector); | |
} | |
HTMLElement.prototype.$$ = function (selector) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bl_info = { | |
"name": "Smart Join", | |
"author": "Jeroen Trines", | |
"version": (1, 0), | |
"blender": (3, 1, 0), | |
"location": "View3D > Object > Smart Join", | |
"description": "Create vertex groups for each mesh before joining objects in Blender", | |
"warning": "", | |
"doc_url": "", | |
"category": "Object", |
OlderNewer