pcregrepは複数行のgrepとして使える。
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
--- sqlite3 inner joinとleft joinの例 | |
-- table Hogeがあったら削除 | |
drop table if exists Hoge; | |
-- table Hogeがなかったら作る | |
create table if not exists Hoge ( | |
name varchar(255) not null, | |
age int not null |
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
type UseSWR<T> = typeof useSWR< | |
T, | |
unknown, | |
Partial<PublicConfiguration<T, unknown, BareFetcher<T>>> | undefined | |
> | |
const getHoge: UseSWR<Hoge> = useSWR |
typeormのDataSouce周りを調べてみましたのでまとめます。
DataSourceの初期化はDataSourceインスタンスのinitializeメソッドを呼び出して行う。 DataSourceの生成でDBの設定をする。
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 glob | |
import os | |
import re | |
paths = glob.glob("./*.*.json") | |
for path in paths: | |
file = os.path.basename(path) | |
pattern = r".*\.(.*\.json)" |
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 os | |
path = "./hogehoge.txt" | |
distpath = "./hogehoge2.txt" | |
os.rename(path, distpath) |
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 re | |
import glob | |
txt = "hogehoge[abccbbss, bccc, [caaa, caaa], abb,]" | |
def matchlastComma(txt): | |
pattern = r"(.*)," | |
m = re.findall(pattern, txt, flags=(re.MULTILINE | re.DOTALL)) | |
if len(m) == 0: |
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 os | |
path = "./hogehoge.txt" | |
with open(path, mode='w') as f: | |
f.write("a") | |
with open(path) as f: | |
t = f.read() | |
print(t) |
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 glob | |
files = glob.glob("./*") | |
for file in files: | |
print(file) |
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 os | |
path = "./hogehoge.txt" | |
with open(path, mode="w") as f: | |
f.write("a") | |
NewerOlder