This file contains hidden or 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 | |
| # 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" |
This file contains hidden or 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
| function highlightElement(selector) { | |
| function createOverlay() { | |
| const overlayStyle = { | |
| position: 'fixed', | |
| width: 100, | |
| height: 100, | |
| top: 0, | |
| left: 0, | |
| right: 0, | |
| bottom: 0, |
This file contains hidden or 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
| 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 "\`\`\`" |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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
| 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')) |
This file contains hidden or 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
| // 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[]]; | |
| } | |
| } |
This file contains hidden or 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 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"): |
OlderNewer