Using additionalProperties: false to remove undefined fields from an object.
When filtering, an object that validates against the provided schema will have
any undefined properties removed if additionalProperties is set to false.
This behaviour prevents the usual additionalProperties: false behaviour from
working. As such when validating an object to see if it is valid against the
provided schema, the value of additionalProperties should be evaluated as
though it were set to true.
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
| #!/usr/bin/env drush | |
| <?php | |
| use \Drupal\node\Entity\Node; | |
| use \Drupal\file\Entity\File; | |
| $posts = []; | |
| $tempPost; |
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
| #!/usr/bin/env bash | |
| # This script sets a group of devices to a specific commit, | |
| # currently it will look for devices in an app that have an environment variable called "TEST" | |
| # these devices will then update to whatever commit is supplied as arg $1 | |
| ./check-configuration.sh || exit 1 | |
| COMMIT_HASH=$1 | |
| source ./resin.env |
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 KNOWN_SCHEMA_FORMATS = [ | |
| 'data-url', | |
| 'date', | |
| 'date-time', | |
| 'email', | |
| 'hostname', | |
| 'idn-email', | |
| 'idn-hostname', | |
| 'ipv4', | |
| 'ipv6', |
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
| docker run --name assignment -p 3001:3001 -dit node | |
| docker cp . assignment:app | |
| docker exec -it assignment bash | |
| # enter the app directory and install the project etc | |
| cd app && npm i | |
| # once you're done, clean up the container | |
| docker stop assignment | |
| docker rm assignment |
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 wait = () => { | |
| return new Promise((resolve) => { | |
| setTimeout(resolve, 5) | |
| }) | |
| } | |
| exports.fill = async (dungeon, ctx, cellSize) => { | |
| const width = dungeon.tiles.length | |
| const height = dungeon.tiles[0].length |
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
| "====[ Syntastic ]============================================ | |
| function! SetJSChecker() | |
| for name in [ '.eslintrc', '.eslintrc.yml', '.eslintrc.json' ] | |
| let file = findfile(name, '.;') | |
| if len(file) > 0 | |
| echo "Found eslint configuration file" | |
| let b:syntastic_checkers = ['eslint'] | |
| return | |
| endif | |
| endfor |
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
| #!/usr/bin/env drush | |
| <?php | |
| /** | |
| * This script will echo valid php for programatically creating a field. | |
| * The field must already exist for this to work, so it's value is in deploying | |
| * changes from a development environment onto a live site. | |
| * | |
| * Call the script with "drush fieldexport.drush.php" specifying a field name using |
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 os | |
| from balena import Balena | |
| balena = Balena() | |
| token = os.environ['TOKEN'] | |
| appId = os.environ['APP_ID'] | |
| balena.auth.login_with_token(token) | |
| user = balena.auth.who_am_i() | |
| app = balena.models.application.get(appId) |
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
| delete-merged-branches = "!f() { git checkout --quiet master && git branch --merged | grep --invert-match '\\*' | xargs -n 1 git branch --delete; git checkout --quiet @{-1}; }; f" |
OlderNewer