Skip to content

Instantly share code, notes, and snippets.

(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() {
@podhmo
podhmo / readme.md
Last active April 26, 2024 15:49
スマホのフリック入力で手軽に記述できるDSL

はじまり

x/twitterでの以下の発言をスマホでの生産という文脈でもう一度言語化してみようと思う。

実はスマホのフリック入力で書きやすいのはS式なのでは?

()()()()()()()

「」も使えなくはないけれど

package main
import (
"embed"
"net/http"
)
//go:embed index.html
//go:embed style.css
var public embed.FS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>card登録用のtokenを取得</title>
<link rel="stylesheet" href="style.css" />
<script src="https://js.stripe.com/v3/"></script>
</head>
import express from "express";
import process from "process";
async function main() {
const app = express();
const port = 3000;
app.get("/hello", (req, res) => {
res.send("Hello World!");
});
@podhmo
podhmo / x.py
Created February 10, 2024 06:04
class A:
def __init__(self):
self.__c = 1
def a(self):
self.__c += 1
def show(self):
print(f"{self=} a.c is {self.__c=}")
serve:
go build -o /tmp/xxx main.go && /tmp/xxx
tree:
tree .
click-a:
DEBUG=pw:api npx tsx main.ts
click-button:
DEBUG=pw:api npx tsx main2.ts
--- 2.0.md 2023-12-09 17:21:54
+++ 3.0.0.md 2023-12-09 17:21:54
@@ -1,36 +1,83 @@
# OpenAPI Specification
-## (fka Swagger RESTful API Documentation Specification)
-#### Version 2.0
+#### Version 3.0.0
-The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](http://www.ietf.org/rfc/rfc2119.txt).