Skip to content

Instantly share code, notes, and snippets.

@podhmo
podhmo / readme.md
Last active September 19, 2024 12:21
pythonのコードの壊れやすさと主流のユーザーの変化に付いてのつぶやきまとめ

Pythonユーザーの変遷

Pythonも主要なユーザーが変わったよな。

例えばDjangoとかはrailsなどに対してオールインワンで持つことで一貫性を維持してたしユーティリティなどを自前で持ちpypiに挙げられるパッケージはnpmのそれに比べて粒度が大きかった。

また2.xのときはLTS的なものが長かった。


@podhmo
podhmo / readme.md
Last active September 11, 2024 09:54
mermaidで色々なstyleがある?
@podhmo
podhmo / readme.md
Created September 11, 2024 09:48
mermaidでアーキテクチャ図がサポートされてる
default: clean
mkdir -p bin
tree > tree.out
go build -buildmode=plugin -o bin/.plugin_a.so ./plugins/a
go build -buildmode=plugin -o bin/.plugin_b.so ./plugins/b
go build -buildmode=plugin -o bin/.plugin_c.so ./plugins/c
go build -o bin/foo ./
./bin/foo
clean:
--- /tmp/before.txt 2024-08-07 11:40:14
+++ /tmp/after.txt 2024-08-07 11:40:14
@@ -1,3 +1,4 @@
+"golang.org/x/tools/go/analysis/passes/appends"
"golang.org/x/tools/go/analysis/passes/asmdecl"
"golang.org/x/tools/go/analysis/passes/assign"
"golang.org/x/tools/go/analysis/passes/atomic"
@@ -6,7 +7,10 @@
"golang.org/x/tools/go/analysis/passes/cgocall"
"golang.org/x/tools/go/analysis/passes/composite"
import typing as t
import argparse
import sys
import subprocess
import shlex
import json
from datetime import datetime
from itertools import zip_longest
from concurrent.futures import ThreadPoolExecutor, as_completed
@podhmo
podhmo / staticcheck.md
Created July 24, 2024 06:46
staticcheckのchecks一覧
code description
S1000 Use plain channel send or receive instead of single-case select
S1001 Replace for loop with call to copy
S1002 Omit comparison with boolean constant
S1003 Replace call to strings.Index with strings.Contains
S1004 Replace call to bytes.Compare with bytes.Equal
S1005 Drop unnecessary use of the blank identifier
S1006 Use 'for { ... }' for infinite loops
S1007 Simplify regular expression by using raw string literal
(defun my:count-chars-of-first-line ()
(interactive)
(save-excursion
(save-restriction
(goto-char (point-min))
(let (beg end)
(beginning-of-line)
(setq beg (point))
(end-of-line)
(setq end (point))
;; cl-letfを利用すれば内部の関数の呼び出しをすげかえる
(defun my:hello ()
(message "hello %s" "world"))
;; これは単に *Messages* bufferに出力するだけ
(my:hello)
;; これは kill-ring に追加もしてくれる
(cl-letf ((original-message (symbol-function 'message))
package main
import (
"encoding/json"
"os"
"runtime/debug"
)
func main() {
defer func() {