Skip to content

Instantly share code, notes, and snippets.

View hidsh's full-sized avatar

yakshaver hidsh

View GitHub Profile
@hidsh
hidsh / cutting-sheet-mba13-2020.svg
Last active April 9, 2022 07:34
Old fashioned Octocat Sticker for Macbook Air M1 2020
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <stdio.h>
#include <assert.h>
int x = 10;
int main(void)
{
assert(x < 5);
printf("assert test\n");
#include <stdio.h>
#include <stdlib.h> // abort
int main(void)
{
printf("start\n");
abort();
printf("end\n");
@hidsh
hidsh / picoprog.sh
Last active March 20, 2022 12:26
trivial shell script to program into raspberry pi pico using openocd
#!/bin/sh
PGM='openocd'
if [ $# != 1 ]; then
echo "USAGE: $(basename $0) ELF_PATH"
exit -1;
fi
if [ ! $(which $PGM) ]; then
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.
@hidsh
hidsh / current_source.js
Created February 13, 2022 03:12
innerHTML で表示変更した時にソース表示するには?
// ↓これをChrome のコンソールに入力して、結果をコピー
console.log(document.getElementsByTagName('html')[0].innerHTML);
// 元ネタ: ↓ここのNo.3の回答
// https://oshiete.goo.ne.jp/qa/6191173.html
@hidsh
hidsh / death_march.md
Created February 10, 2022 12:41 — forked from voluntas/death_march.md
デスマーチが起きる理由 - 3つの指標

デスマーチが起きる理由 - 3つの指標

著者: 青い鴉(ぶるくろ)さん @bluecrow2

これは結城浩さんの運用されていた YukiWiki に当時 Coffee 様 (青い鴉(ぶるくろ)さん)がかかれていた文章です。 ただ 2018 年 3 月 7 日に YukiWiki が運用停止したため消えてしまいました。その記事のバックアップです。

今は 404 ですが、もともとの記事の URL は http://www.hyuki.com/yukiwiki/wiki.cgi?%A5%C7%A5%B9%A5%DE%A1%BC%A5%C1%A4%AC%B5%AF%A4%AD%A4%EB%CD%FD%CD%B3 になります。

昔、自分がとても感銘を受けた文章なので、このまま読めなくなるのはとてももったいないと思い、バックアップとして公開しています。

@hidsh
hidsh / node-args-test.js
Created January 24, 2022 16:26
nodeではargs[2]が最初の引数になる。
console.log(`arg length: ${process.argv.length}\n`);
for(let i=0; i<process.argv.length; i++){
console.log(`argv[${i}]: ${process.argv[i]}`);
}
console.log('\n※ nodeではargs[2]が最初の引数になる。');
@hidsh
hidsh / README.md
Last active January 23, 2022 15:06
raspberry pi 対策:長時間操作がないとwifiが切れる

対策:長時間操作がないとwifiが切れる

  1. ~/reconnect.sh に置く

  2. 1分おきに実行するように crontab -e して次を貼り付け

# disalble syslog from cron '(CRON) info (No MTA installed, discarding output)'
MAILTO=""
@hidsh
hidsh / motd-pi-zero.sh
Created January 23, 2022 12:55
My motd
#!/bin/sh
# output by `figlet Pi zero'
# try `showfigfonts Pi zero' to choose another font!
echo "\e[33m
____ _ \e[1m\e[32mYou've logged into:\e[33m
| _ \(_) _______ _ __ ___
| |_) | | |_ / _ \ '__/ _ \
| __/| | / / __/ | | (_) |
|_| |_| /___\___|_| \___/