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
import { ChevronDownIcon, ChevronRightIcon } from "@chakra-ui/icons" | |
import { Box, chakra, Icon, useDisclosure } from "@chakra-ui/react" | |
import { useMemo } from "react" | |
export const json = (obj: any) => | |
obj === undefined ? "undefined" : JSON.stringify(obj, null, 2) | |
export const closeBrackets = (str: string) => | |
str.replace( | |
/[\(\[\{]+$/, |
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
rsync.exe --rsh="/bin/ssh" @args | |
# tested 2023-03-15, SSH keys should also work out of the box | |
# for using a different port, do e.g. `--rsh="/bin/ssh -p 1234"` |
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
// ==UserScript== | |
// @name Springer Link add download-URLs to search results | |
// @version 0.1 | |
// @author J.-T. Brinkmann | |
// @include https://link.springer.com/search* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; |
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
// convert WITHOUT considering multiple values | |
// every value will be a string | |
const parseSearchParams = (data) => [...new URLSearchParams(data).entries()].reduce((acc,[key, val]) => (acc[key]=val,acc), {}) | |
// convert WITH considering multiple values | |
// every value will be a either a string or an array of strings | |
const parseSearchParamsMultiple = (data) => [...new URLSearchParams(data)].reduce((acc,[key, val]) => (acc[key] = acc[key]?[].concat(acc[key], val) : val, acc), {}) | |
// test cases | |
const testSingle = "a=1&b=2&c=3" |
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 | |
## Alternative Versions | |
# only allows space separated variable name list | |
# example: destruct a b c = arr | |
destruct() { | |
for ((i=1;i < $#-1; ++i)) do | |
local value_adress="${!#}[$i-1]" | |
declare -g "${!i}=${!value_adress}" | |
done |
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
<!DOCTYPE html> | |
<body style="font-family: sans-serif;"> | |
<p> | |
<label> | |
Youtube URLs:<br> | |
<textarea id="input" style="box-sizing: content-box; width: 100%; min-height: 8em; line-height: 1.4em; padding: 0.2em"></textarea> | |
</label> | |
</p> | |
<p> | |
<label> |
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
<!DOCTYPE html> | |
<body style="font-family: sans-serif"> | |
<form> | |
<label> | |
Video-URL or ID: | |
<input id="videourl" value="3q_iqrvnC_4" style="width: 40em" /> | |
</label> | |
<p id="warning" style="visibility: hidden; background: yellow; font-weight: bold;"> | |
Warning: the extracted video id seems unusual | |
</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
javascript:$('body').css('color-adjust','exact');fetch('/css/bootstrap.min.css').then(r=>r.text()).then(b => { b = b.replace(/@media\s+print\s*\{[\s\S]*?\}\s*\}/g, '').replace(/url\(\./g,'url(/css/.'); $a = $('link[href="/css/bootstrap.min.css"]').attr('media', 'none'); $('<style>').text(b).insertAfter($a) }) |
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
param ( | |
[string] $inFilePath, | |
[string] $outFilePath = $false | |
) | |
# older PowerPoint versions don't support exporting to MP4 (e.g. 2010) | |
# use WMV as fallback and if necessary convert via ffmpeg (not part of this script) | |
if ([Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType]::ppSaveAsMP4) { | |
$outExt = "mp4" | |
$outExtType = [Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType]::ppSaveAsMP4 |
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
$inputs = ls -R -F *.mp4 | |
$i = 0 | |
for ($input in $inputs) { | |
Write-Progress -Activity "Converting Videos" -Status "$(++$i / $inputs.Length)% $($input.Name)" -PercentComplete $($i / $inputs.Length) | |
$output = Join-Path "..\compressed" ($_ | Resolve-Path -Relative) | |
if (Test-Path $output) { | |
echo "already exists: $output" | |
} else { | |
mkdir ($output | Split-Path) | |
ffmpeg -hide_banner -i $input -movflags faststart -r 25 -vf scale=-1:720 -tune stillimage $output |
NewerOlder