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
;; 関数のトップレベルでしか動作しないので注意 | |
(defmacro my-assert (form) | |
`(let* ((backtrace (backtrace-frame 2)) | |
(func-name (nth 1 backtrace))) | |
(unless ,form (error "Assert in %s(): should be %S" func-name ',form)))) |
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
// soatari-matrix test for pro micro | |
// マトリクスのテスト RC1..RC3を順ぐりにLO出力にして、LO出力以外のRCxを入力にしてSWxxをセンスする | |
// マトリクスが変化したときのAD値を表示する | |
// 7 8 9 <-- pin number | |
// RC1 RC2 RC3 | |
// ---------------- | |
// - , SW12, SW13 | |
// SW21, - , SW23 | |
// SW31, SW32, - |
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
(defun my-consult-ripgrep (&optional parg dir initial) | |
"`consult-ripgrep` with symbol-at-point. | |
Besides, it can be Specified top directory to search using prefix-argument, e.g. C-u." | |
(interactive "p") | |
(setq initial (thing-at-point 'symbol)) | |
(setq dir (pcase parg | |
(1 nil) ;; not given prefix-arg | |
(t (let ((insert-default-directory t)) | |
(read-directory-name "Ripgrep Dir: "))))) | |
(consult-ripgrep dir initial))) |
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
# コマンドライン(powershell)で Windows 10 の復元ポイントを作成 | |
# | |
$comment = Read-Host "コメント" | |
if([string]::IsNullOrEmpty($comment)) { | |
$comment = "変更" | |
} | |
#Write-Output $comment |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#include <stdio.h> | |
#include <assert.h> | |
int x = 10; | |
int main(void) | |
{ | |
assert(x < 5); | |
printf("assert test\n"); |
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
#include <stdio.h> | |
#include <stdlib.h> // abort | |
int main(void) | |
{ | |
printf("start\n"); | |
abort(); | |
printf("end\n"); |
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
#!/bin/sh | |
PGM='openocd' | |
if [ $# != 1 ]; then | |
echo "USAGE: $(basename $0) ELF_PATH" | |
exit -1; | |
fi | |
if [ ! $(which $PGM) ]; then |
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
vm-ubuntu:~$ mkdir pico | |
vm-ubuntu:~$ cd pico | |
vm-ubuntu:~/pico$ git clone --recursive https://github.com/raspberrypi/pico-sdk.git | |
Cloning into 'pico-sdk'... | |
Warning: Permanently added the ECDSA host key for IP address '13.114.40.48' to the list of known hosts. | |
remote: Enumerating objects: 4766, done. | |
remote: Counting objects: 100% (1217/1217), done. | |
remote: Compressing objects: 100% (436/436), done. | |
remote: Total 4766 (delta 1006), reused 794 (delta 769), pack-reused 3549 | |
Receiving objects: 100% (4766/4766), 2.13 MiB | 3.11 MiB/s, done. |
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
// ↓これをChrome のコンソールに入力して、結果をコピー | |
console.log(document.getElementsByTagName('html')[0].innerHTML); | |
// 元ネタ: ↓ここのNo.3の回答 | |
// https://oshiete.goo.ne.jp/qa/6191173.html |