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 -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')" | |
| # syntax = docker/dockerfile:1.4.0 | |
| FROM node:20 | |
| WORKDIR /root | |
| RUN npm install sqlite3 |
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 | |
| __http_request_example(){ | |
| curl \ | |
| --silent \ | |
| --location http://ip.jsontest.com \ | |
| --write-out "\n%{http_code}" | |
| } | |
| __response_formatter(){ |
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
| # RTL9210 M.2 adapter TRIM/discard via unmap command | |
| ACTION=="add|change", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="9210", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap" | |
| # Qudelix 5k control via Chromium extension (HID permissions) | |
| KERNEL=="hidraw*", ATTRS{idVendor}=="0a12", ATTRS{idProduct}=="4005", MODE="0666" | |
| KERNEL=="hidraw*", ATTRS{idVendor}=="0a12", ATTRS{idProduct}=="4010", MODE="0666" | |
| # WD USB HDD proper shutdown on system shutdown (customize the idProduct and idVendor) | |
| ACTION=="add|change", ATTRS{idVendor}=="1058", ATTRS{idProduct}=="2626", SUBSYSTEM=="scsi_disk", ATTR{manage_system_start_stop}="1" |
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
| from typing import List, Tuple, Any | |
| import json | |
| def ensure_no_duplicate_keys(object_pairs: List[Tuple[str, Any]]) -> dict: | |
| value = dict(object_pairs) | |
| if len(value) != len(object_pairs): | |
| raise ValueError("Duplicate JSON map keys") | |
| return value | |
| if __name__ == "__main__": |
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 pygit2 | |
| def checkout_branch(path, branch_name): | |
| repo = pygit2.Repository(path) | |
| # If the branch isn't already in the local list, | |
| # you have to create a ref for it to point at | |
| # in order to avoid detached head state | |
| if branch_name not in repo.branches.local: |
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
| """ | |
| This script converts a properly formatted CSV file to a JSON list. | |
| The CSV must have the `Project ID` in the first column and `OP Amount` in the second column. | |
| The `Project ID` can be found at the end of the voting URL, eg: | |
| https://vote.optimism.io/retropgf/3/application/0xd730a803f5714c7f1b5e518edd57121d1b64c8c91cf611ae5f226cf9bb4b963f | |
| https://round3.optimism.io/projects/0xd730a803f5714c7f1b5e518edd57121d1b64c8c91cf611ae5f226cf9bb4b963f | |
| `Project ID` = 0xd730a803f5714c7f1b5e518edd57121d1b64c8c91cf611ae5f226cf9bb4b963f |
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
| CLEANUP_MODULES_ON_EXIT_REGEX = re.compile(r"(?i)CleanupModulesOnExit\s*=\s*(yes|true)") | |
| def _is_modules_cleanup_enabled(): | |
| """Verify firewalld modules cleanup config is enabled. | |
| :returns: Whether or not the CleanupModulesOnExit is set to true in | |
| firewalld config. | |
| :rtype: bool | |
| """ | |
| # Return false if the config file does not exist. Either it means that |
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
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
| <addon id="service.autoexec" name="Autoexec Service" version="1.0.0" provider-name="evinjaff"> | |
| <requires> | |
| <import addon="xbmc.python" version="3.0.0"/> | |
| </requires> | |
| <extension point="xbmc.service" library="autoexec.py"> | |
| </extension> | |
| <extension point="xbmc.addon.metadata"> | |
| <summary lang="en_GB">Automatically run python code when Kodi starts.</summary> | |
| <description lang="en_GB">The Autoexec Service will automatically be run on Kodi startup.</description> |