How to check if a variable is set in Bash?
Q: from 2011
A: from 2021
https://stackoverflow.com/a/65482850/202553
if test "${name+x}"; then
<?php | |
// $controller->addFlashMessage("You were logged out.", FlashMessage::WARNING); | |
// $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\Extbase\\Object\\ObjectManager'); | |
// $configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\FrontendConfigurationManager'); | |
// $configuration = $configurationManager->getTypoScriptSetup(); | |
// DebugUtility::debug(['view' => $view, 'controller' => $event->getController()]); | |
// DebugUtility::debug(['fe_user' => $GLOBALS['TSFE']->fe_user, 'content' => $GLOBALS['TSFE']->content]); |
How to check if a variable is set in Bash?
Q: from 2011
A: from 2021
https://stackoverflow.com/a/65482850/202553
if test "${name+x}"; then
--- | |
title: "-" | |
author: "Knut Behrends, `r lubridate::year(lubridate::now())`" | |
summary: "" | |
date: '`r paste0("2022 / updated ", Sys.Date())`' | |
output: | |
html_document: | |
# CSS file must exist for knit() to succeed | |
# styles.css: img { width:150%; } | |
# css: styles.css |
# attribute values | |
curl -sL "${url}${urlparams}" \ | |
| xidel -s -e "distinct-values(//node()[attribute::*])" \ | |
| perl -ple 's/\s+$//' \ | |
| cat -s -n | head -100 | |
# attribute names | |
curl -sL "${url}${urlparams}" | xidel -s -e 'distinct-values(//@*)' | |
# element names in a document |
// model | |
document.querySelectorAll("button.v-btn.v-btn--icon.v-btn--small i").forEach( el => el.click()) | |
// form | |
document.querySelectorAll("ul button.v-btn.v-btn--icon.v-btn--small i").forEach( el => el.click()) | |
page = PAGE | |
page.10 = TEXT | |
page.10.value ( | |
<div style="width: 800px; margin: 15% auto;"> | |
<div style="width: 300px;"> | |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 42"><path d="M60.2 14.4v27h-3.8v-27h-6.7v-3.3h17.1v3.3h-6.6zm20.2 12.9v14h-3.9v-14l-7.7-16.2h4.1l5.7 12.2 5.7-12.2h3.9l-7.8 16.2zm19.5 2.6h-3.6v11.4h-3.8V11.1s3.7-.3 7.3-.3c6.6 0 8.5 4.1 8.5 9.4 0 6.5-2.3 9.7-8.4 9.7m.4-16c-2.4 0-4.1.3-4.1.3v12.6h4.1c2.4 0 4.1-1.6 4.1-6.3 0-4.4-1-6.6-4.1-6.6m21.5 27.7c-7.1 0-9-5.2-9-15.8 0-10.2 1.9-15.1 9-15.1s9 4.9 9 15.1c.1 10.6-1.8 15.8-9 15.8m0-27.7c-3.9 0-5.2 2.6-5.2 12.1 0 9.3 1.3 12.4 5.2 12.4 3.9 0 5.2-3.1 5.2-12.4 0-9.4-1.3-12.1-5.2-12.1m19.9 27.7c-2.1 0-5.3-.6-5.7-.7v-3.1c1 .2 3.7.7 5.6.7 2.2 0 3.6-1.9 3.6-5.2 0-3.9-.6-6-3.7-6H138V24h3.1c3.5 0 3.7-3.6 3.7-5.3 0-3.4-1.1-4.8-3.2-4.8-1.9 0-4.1.5-5.3.7v-3.2c.5-.1 3-.7 5.2-.7 4.4 0 7 1.9 7 8.3 0 2.9-1 5.5-3.3 6.3 2.6.2 3.8 3.1 3.8 7.3 0 6.6-2.5 9-7.3 9"/><path fill="#FF8700" d="M31.7 28.8c-.6.2-1.1.2-1.7.2-5.2 0-12.9-18.2-12.9-24.3 0 |
#!/usr/bin/env bash | |
## Christian Ştefănescu @stchris_ 2022 Jun 17 | |
## Handy pattern to put metadata from photos into a #sqlite database for easy querying: | |
exiftool -csv *.JPG > photos.csv | |
## Convert the csv to sqlite3 | |
sqlite3 photos.db -cmd \ | |
".mode csv" ".import photos.csv photos" "select filename, imagewidth, imageheight from photos;" ".quit" |
:p rdf:range :v | |
:q rdfs:subPropertyOf :p | |
:a :q :b | |
=> :b rdf:type :v | |
:b is the object in a statement with property :q, | |
:q is subproperty of :p and |
wget -O /tmp/YaHei.Consolas.1.12.zip https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/uigroupcode/YaHei.Consolas.1.12.zip | |
unzip /tmp/YaHei.Consolas.1.12.zip | |
sudo mkdir -p /usr/share/fonts/consolas | |
sudo mv YaHei.Consolas.1.12.ttf /usr/share/fonts/consolas/ | |
sudo chmod 644 /usr/share/fonts/consolas/YaHei.Consolas.1.12.ttf | |
cd /usr/share/fonts/consolas | |
sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv |