- Install DevUp with
brew install devuporpip install devup. - Clone the project with
de clone user/myproject. - Prepare your local development environment
de up. - Test and lint!
de testde lint
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 google.cloud.exceptions | |
| import google.cloud.storage | |
| class GCSFileStore: | |
| def __init__(self, credentials_path, bucket_name): | |
| Client = google.cloud.storage.Client | |
| client = Client.from_service_account_json(credentials_path) | |
| self._bucket = client.bucket(bucket_name) |
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
| httpinfo () { | |
| local urlorhost=$1 | |
| local host=${urlorhost#*//} | |
| local bold=$(tput setaf 37); | |
| local reset=$(tput sgr0); | |
| echo "${bold}DNS records:${reset}" | |
| dig +nocmd ${host} any +multiline +noall +answer; |
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
| def not_found_error(detail): | |
| error = {'id': 'not_found', 'detail': detail} | |
| return JSONApiObject(errors=[error]) | |
| class JSONApiObject: | |
| """Container for JSON API response.""" | |
| def __init__(self, data=None, errors=None): | |
| self.data = data |
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
| # https://github.com/edenhill/librdkafka/wiki/Using-SSL-with-librdkafka | |
| apk add --update openssl-dev | |
| curl https://codeload.github.com/edenhill/kafkacat/tar.gz/master | tar xzf - && cd kafkacat-* && bash ./bootstrap.sh | |
| ./kafkacat -C -b ... -t TOPIC -X 'security.protocol=ssl' -X ssl.certificate.location=tls.crt -X ssl.key.location=tls.key |
This is an argument in favor of using single underscore for declaring internal attributes (methods or variables).
Use one leading underscore only for non-public methods and instance variables.
...
Even with __all__ set appropriately, internal interfaces
(packages, modules, classes, functions, attributes or other names)
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
| require 'securerandom' | |
| require 'date' | |
| require 'googleauth' | |
| require 'google/apis/cloudtrace_v1' | |
| class CloudTrace | |
| def initialize(project_id) | |
| @project_id = project_id |
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
| require 'securerandom' | |
| require 'date' | |
| require 'googleauth' | |
| require 'google/apis/cloudtrace_v1' | |
| service = Google::Apis::CloudtraceV1::CloudTraceService.new | |
| service.authorization = Google::Auth.get_application_default(['https://www.googleapis.com/auth/trace.append']) | |
| project_id = 'XXXXX' |