Skip to content

Instantly share code, notes, and snippets.

Avatar

Martijn Saly thany

  • We are you
  • Netherlands
View GitHub Profile
@thany
thany / get-wikipedia-images.js
Created Jan 14, 2020
Returns a list of source urls of all images used on a single wikipedia article. Use this in the console.
View get-wikipedia-images.js
(await Promise.all(
[...document.querySelectorAll('#bodyContent a.image')]
.map(node => (async (url) => (new DOMParser().parseFromString(
await window.fetch(url).then(response => response.text()),
'text/html'
).querySelector('.fullMedia a.internal') || { }).href)(node.href))
)).join('\n');
@thany
thany / non-cancellable.cmd
Created Nov 6, 2019
A CMD script that is not cancellable by pressing Ctrl+C
View non-cancellable.cmd
@echo off
setlocal
if "%~1" equ "NonCancelable" goto NonCancelable
start "" /B cmd /C "%~F0" NonCancelable
exit
:NonCancelable
rem DO STUFF HERE
@thany
thany / suppress-terminate-batch-job.cmd
Last active Nov 6, 2019
A CMD script that suppresses the "Terminate batch job" question upon pressing Ctrl+C, and ends the script immediately instead
View suppress-terminate-batch-job.cmd
@echo off
if "%~1"=="-FIXED_CTRL_C" (
shift
) else (
call <nul %0 -FIXED_CTRL_C %*
goto :EOF
)
rem DO STUFF HERE
@thany
thany / get-denso-mapcode.sh
Last active Aug 28, 2019
Get Denso Mapcode from Denso server using a bash command
View get-denso-mapcode.sh
wget http://post.denso-communications.jp/dn/navicon_start.php --method=POST --body-data="lat=35.872722875676274&lng=139.73869658316153" -O - -q | grep -Po '(?<=id="mapcode">)([^<]*)'
@thany
thany / .eslintrc
Created Jan 3, 2019
Batch HDR for Photoshop
View .eslintrc
{
"env": {
"browser": true,
"amd": true,
"es6": true
},
"parserOptions": {
"sourceType": "module"
},
"extends": "eslint:recommended",
You can’t perform that action at this time.