Skip to content

Instantly share code, notes, and snippets.

View hidsh's full-sized avatar

yakshaver hidsh

View GitHub Profile
@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
| _ \(_) _______ _ __ ___
| |_) | | |_ / _ \ '__/ _ \
| __/| | / / __/ | | (_) |
|_| |_| /___\___|_| \___/
@hidsh
hidsh / ping-parallel.sh
Last active January 22, 2022 15:07
Mac: アドレス範囲(192.168.1.1〜254)をpingする
#!/bin/sh
base=192.168.1
#beg=1
#end=254
# Mac (Mac's ping command has some different options (e.g. -i) than that of Linux?)
echo ${base}.{1..254} | xargs -P999 -n1 ping -c1 -t1 -i2| grep ttl
@hidsh
hidsh / README.md
Last active January 23, 2022 00:23
Python: CUIでGitHubの草画像をSlackに投稿する

slack-post-github-grass

CUIでSlackに草画像を投稿します。

投稿先のワークスペースはこちら → 招待リンク

Install

$ cd /usr/local/bin # とか PATH の通ったところに移動
@hidsh
hidsh / mixin-example.py
Created January 17, 2022 12:31
python ミックスインの例
class BaseMixin:
"""ミックスインなので自身のインスタンス化を禁止"""
def __init__(self):
raise Exception('This is Mixin, thus cannot be instantiated itself.')
class SpeakMixin(BaseMixin):
"""発言用のspeakメソッドを定義"""
def speak(self, s):
print(f'{self.name}: {s}');
@hidsh
hidsh / default-main.js
Last active October 7, 2022 05:12
js のexport / import をローカルで確認( export default class編)
'use strict';
import Hoge from './default-sub.js';
let hoge = new Hoge();
hoge.print();
@hidsh
hidsh / todo と打ち消し線.md
Last active January 1, 2022 13:14
gfm テスト

基本

~~hoge~~ hoge

- [ ] hoge

  • hoge

OK

~~- [ ] hoge fuga~~

  • hoge fuga