openssl base64 -in IN_FILE -out OUT_FILE -A
-A: to inline the result in the outfile
| import json | |
| from openant.easy.node import Node | |
| from openant.devices import ANTPLUS_NETWORK_KEY | |
| from openant.devices.heart_rate import HeartRate, HeartRateData | |
| from openant.devices.bike_speed_cadence import BikeCadence, BikeCadenceData | |
| from openant.devices.power_meter import PowerMeter, PowerData | |
| import paho.mqtt.client as mqtt | |
| # Load configuration | |
| def load_config(config_file="config.json"): |
| // const filteredArray = myArray.filter(str => str.length > 255); | |
| // becomes | |
| // const [filteredArray, rejectedArray] = myArray.filterSplit(str => str.length > 255); | |
| declare global { | |
| interface Array<T> { | |
| filterSplit(predicate: (item: T, index: number, array: T[]) => boolean): [T[], T[]]; | |
| } | |
| } |
| console.log(parse(base64ToString(window.courseData)).course.lessons.reduce((acc, l) => acc.concat(l.items), []).filter(b => b.type === "knowledgeCheck").map(kc => kc.items[0].answers.filter(a => a.correct).map(a => kc.items[0].title.substr(0, 30) + '... : ' + a.title).join('\n')).join('\n---\n')) |
| # Do not use project root folder as it would catch the package.json file | |
| SRC_LOCATION=apps | |
| PACKAGE_JSON_LOCATION=package.json | |
| for dep in $(jq -r '.dependencies | keys[]' $PACKAGE_JSON_LOCATION) | |
| do | |
| if grep -R -m 1 $dep $SRC_LOCATION > /dev/null; | |
| then | |
| echo "✅ " $dep |
| printCodeFileAsMarkdown() { for filepath in "$@"; do | |
| filename=$(basename -- "$filepath") | |
| dir=$(dirname -- "$filepath") | |
| extension="${filename##*.}" | |
| if [ -f "$filepath" ]; then | |
| echo "\`$filename\` under \`$dir\`:" | |
| echo "" | |
| echo "\`\`\`$extension" | |
| cat "$filepath" | |
| echo "\`\`\`" |
| function highlightElement(selector) { | |
| function createOverlay() { | |
| const overlayStyle = { | |
| position: 'fixed', | |
| width: 100, | |
| height: 100, | |
| top: 0, | |
| left: 0, | |
| right: 0, | |
| bottom: 0, |
| #!/bin/bash | |
| # Install command: | |
| # curl https://gist.githubusercontent.com/florianpasteur/649f735ea786130922dbdd8308e547a2/raw -o .git/hooks/post-commit && chmod +x .git/hooks/post-commit | |
| echo "POST COMMIT HOOK" | |
| COMMIT_HASH=HEAD | |
| echo "commit hash: $COMMIT_HASH" |
| <html> | |
| <head> | |
| <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> | |
| <title>Bootstrap 5 Flexbox table</title> | |
| <style> | |
| /* Css not used, as reference only */ | |
| .table { | |
| display: flex; | |
| flex-flow: column nowrap; |
| ## FINDER | |
| # show file extension | |
| defaults write NSGlobalDomain AppleShowAllExtensions -bool true | |
| # quit options | |
| defaults write com.apple.finder QuitMenuItem -bool true; |