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 FRETBOARD: &str = "◯ ◯ ◯ ◯ ◯ ◯ | |
| ┌─┬─┬─┬─┬─┐ | |
| │ │ │ │ │ │ | |
| ├─┼─┼─┼─┼─┤ | |
| │ │ │ │ │ │ | |
| ├─┼─┼─┼─┼─┤ | |
| │ │ │ │ │ │ | |
| └─┴─┴─┴─┴─┘"; | |
| use clap::Parser; |
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
| [package] | |
| name = "rust_grpc_demo" | |
| version = "0.1.0" | |
| edition = "2021" | |
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
| [dependencies] | |
| tonic = "0.7.1" | |
| tokio = { version = "1.18.0", features = ["macros", "rt-multi-thread"] } |
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 | |
| import json | |
| class Student(object): | |
| def __init__(self, first_name: str, last_name: str): | |
| self.first_name = first_name | |
| self.last_name = last_name | |
| @classmethod | |
| def from_json(cls, 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
| def format(input): | |
| ... | |
| class BracketFormatterCommand(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| whole_region = sublime.Region(0, self.view.size()) | |
| text = self.view.substr(sublime.Region(0, self.view.size())) | |
| formatted_text = format(text) | |
| self.view.replace(edit, whole_region, formatted_text) |
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 sublime | |
| import sublime_plugin | |
| def format(input): | |
| output = "" | |
| counter = 0 | |
| SPACE = ' ' | |
| for char in input: | |
| if char in "([{": | |
| counter += 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
| import sublime | |
| import sublime_plugin | |
| class ExampleCommand(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| self.view.insert(edit, 0, "Hello, World!") |
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
| PurchaseRequest( | |
| itemId: 375, | |
| name: "Spook", | |
| price: Amount( | |
| value: 100, | |
| currency: 'USD' | |
| ), | |
| insurancePolicies=[ | |
| 20931, | |
| 12035 |
- Client (Customer)
- Load Balancer (Greeter)
- Data Center (Coffee Shop)
- Distributed Message Queue (Bulletin Board w/ Sticky Notes)
- Producer (Cashier)
- Consumer (Barista)
- Database (Ledger Book)
Put this helper funciton in your ~/.zshrc or ~/.bash_profile:
release_port() {
pid=$(lsof -ti:$1)
if [ -z $pid ]; then
echo "Nothing is running on port $1"
else
kill $pid
echo "Killed process on port $1 with pid $pid"
NewerOlder