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
Source: https://github.com/zed-industries/community/issues/1526#issuecomment-1543891012 | |
{ | |
// ... | |
"language_overrides": { | |
"Elixir": { | |
"format_on_save": { | |
"external": { | |
"command": "mix", | |
"arguments": ["format", "--stdin-filename", "{buffer_path}", "-"] | |
} |
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
enum Item { | |
File(File), | |
Directory(Directory), | |
} | |
struct File { | |
name: String, | |
} | |
impl File { |
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
class File: | |
def __init__(self, name, contents=""): | |
self.name = name | |
self.content = contents | |
class Directory: | |
def __init__(self, name, items): | |
self.name = name | |
self.items = items |
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
[main] <------- [preview] <------- [stable] | |
^ ^ ^ | |
| | stable release bug PRs target this branch, then stable -> preview, then preview -> main | |
| | | |
| preview release bug PRs target this branch, then preview -> main | |
| | |
new feature PRs target this branch, bug fix PRs relating to new features target this branch | |
One release day, merge | |
- merge preview -> stable |
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
trait IterToString { | |
fn iter_to_string(self, separator: &str) -> String; | |
} | |
impl<T> IterToString for T | |
where | |
T: IntoIterator, | |
T::Item: ToString, | |
{ | |
fn iter_to_string(self, separator: &str) -> String { |
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 create_markdown_table_lines(rows): | |
if not rows: | |
return [] | |
create_row_string = lambda row: f"| {' | '.join(row)} |" | |
headers = list(rows[0].keys()) | |
separators = ["-"] * len(headers) | |
lines = [ |
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
# 1: A true classic | |
# -------------------------------------- | |
animals = ["dog", "cat", "bird", "mouse", "goat"] | |
for animal in animals: | |
print(animal) | |
# 2: A dash of pepper ... | |
# -------------------------------------- |
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
/Users/josephlyons/Desktop/rust_temp/nushell/docs〉ps | first 2 | to json -i 4 02/20/2022 02:29:47 PM | |
[ | |
{ | |
"pid": 47434, | |
"name": "nu", | |
"status": "Running", | |
"cpu": 1.8518518518518519, | |
"mem": 14471168, | |
"virtual": 5180243968 | |
}, |
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 collections import defaultdict | |
currency_combo_strings = ["btcusd","btcgusd","btcdai","btcgbp","btceur","btcsgd","ethbtc","ethusd","ethgusd","ethgbp","etheur","ethsgd","ethdai","bchusd","bchbtc","bcheth","ltcusd","ltcbtc","ltceth","ltcbch","zecusd","zecbtc","zeceth","zecbch","zecltc","batusd","batbtc","bateth","linkusd","linkbtc","linketh","daiusd","oxtusd","oxtbtc","oxteth","filusd","ampusd","paxgusd","compusd","mkrusd","zrxusd","kncusd","storjusd","manausd","aaveusd","snxusd","yfiusd","umausd","balusd","crvusd","renusd","uniusd","enjusd","bntusd","1inchusd","sklusd","grtusd","lrcusd","sandusd","cubeusd","lptusd","bondusd","maticusd","injusd","sushiusd","dogeusd","api3usd","mirusd","ctxusd","alcxusd","ankrusd","ftmusd","xtzusd","axsusd","usdcusd","slpusd","lunausd","ustusd","mco2usd","dogebtc","dogeeth","cvcusd","spellusd","mimusd","galausd","mcusd","ensusd","elonusd","ashusd","wcfgusd","rareusd","radusd","qntusd","maskusd","fetusd","audiousd","nmrusd","rlyusd","rndrusd","shibusd","ldousd","kp3rusd","t |
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 get_color_for_text(text): | |
colors = [ | |
"black", | |
"blue", | |
"green", | |
"orange", | |
"red", | |
"silver", | |
"white", | |
"yellow", |
NewerOlder