Language | Library Name | Description |
---|---|---|
Python | transitions | A lightweight, object-oriented FSM framework. |
Python | PyState | A simple FSM library based on decorators. (Note: The exact GitHub URL might differ) |
JavaScript | javascript-state-machine | A library for finite state machines that can be used in the browser or in Node.js. |
JavaScript | xstate | A library for creating, interpreting, and executing finite state mach |
This file contains 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
inotifywait -e MODIFY -r -m /workspace/src | | |
while read path action file; do | |
lockBuild | |
ext=${file: -3} | |
if [[ "$ext" == ".go" ]]; then | |
echo File changed: $file | |
rerunServer | |
fi | |
unlockBuild | |
done |
This file contains 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 builder AS debug | |
RUN apk add --no-cache git inotify-tools | |
ENV CGO_ENABLED 0 | |
RUN go install -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv@latest | |
RUN go install -v github.com/ramya-rao-a/go-outline@v0.0.0-20210608161538-9736a4bde949 | |
RUN go install -v golang.org/x/tools/gopls@latest | |
RUN go install honnef.co/go/tools/cmd/staticcheck@2022.1 |
This file contains 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
# Files | |
.dockerignore | |
.editorconfig | |
.gitignore | |
.env.* | |
Dockerfile | |
Makefile | |
LICENSE | |
**/*.md | |
**/*_test.go |
This file contains 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 .iterators import TransactionIterator, BigQueryTransaction | |
######################### | |
query_job = client.query(sql) | |
return TransactionIterator(query_job.result()) |
This file contains 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 TypedDict, Optional, List | |
from decimal import Decimal | |
from datetime import datetime | |
class BigQueryTransaction(TypedDict): | |
hash: str | |
nonce: int | |
transaction_index: int | |
from_address: str |
This file contains 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 Iterable, Iterator | |
from .models import BigQueryTransaction | |
class BaseIterator(Iterable): | |
def __init__(self, iterable: Iterator): | |
self.iterable = iterable | |
self._iterator = None | |
def __iter__(self) -> Iterator: |
This file contains 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 google.cloud import bigquery | |
client = bigquery.Client.from_service_account_json(credentials_path) | |
query_job = client.query(sql) | |
return query_job.result() |
This file contains 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 openai | |
def analyze_sentiment(comment): | |
prompt = f"Analyze the sentiment of the following comment: '{comment}'\n\nRating:" | |
response = openai.Completion.create( | |
engine="text-davinci-003", | |
prompt=prompt, | |
temperature=0.3, | |
max_tokens=10, | |
n=1, |
This file contains 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
# Airflow configuration | |
AIRFLOW_USE_MWAA=False | |
# Airflow configuration when AIRFLOW_USE_MWAA = True | |
MWAA_REGION_NAME=us-east-1 | |
MWAA_ENVIRONMENT_NAME=MyAirflowEnv | |
# Airflow configuration when AIRFLOW_USE_MWAA = False | |
AIRFLOW_HOST=localhost | |
AIRFLOW_PORT=8080 | |
AIRFLOW_USER=airflow_user | |
AIRFLOW_PASSWORD=airflow_password |
NewerOlder