Skip to content

Instantly share code, notes, and snippets.

@robstoll
robstoll / js console
Last active December 19, 2019 10:48
update translations for worpress
var wpblocks = wp.data.select('core/block-editor').getBlocks(); a.split('\n').map(x => x.split(';')).filter(x => x[0]!='').forEach(x => {
var blocks = wpblocks.filter(y => y.attributes.content != null && y.attributes.content.replace(/\n/g, ' ') == x[0]);
if (blocks.length > 1) {
console.error("zu viele", blocks);
} else if(blocks.length == 1) {
wp.data.dispatch('core/block-editor').updateBlockAttributes(blocks[0].clientId, {'content': x[1] })
} else if(wp.data.select('core/editor').getEditedPostAttribute('title') == x[0]) {
wp.data.dispatch('core/editor').editPost({ title: x[1] })
}
})
@robstoll
robstoll / build.gradle.kts
Last active December 29, 2020 22:08
gradle kotlin MPP fail build if test previously failed
fun memoizeTestFile(testTask: Test) =
project.file("${project.buildDir}/test-results/memoize-previous-state-${testTask.name}.txt")
tasks.withType<Test> {
testLogging {
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
DEBUG: Using RE2 regex engine
DEBUG: Parsing configs
DEBUG: Checking for config file in /runner/renovate/job_config.json
DEBUG: Detected config in env RENOVATE_CONFIG
{
"config": {
"extends": [
"mergeConfidence:all-badges"
],
"prFooter": "This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/{{platform}}/{{repository}}).",