Skip to content

Instantly share code, notes, and snippets.

View hidsh's full-sized avatar

yakshaver hidsh

View GitHub Profile
@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
@hidsh
hidsh / button-disabled.html
Created December 14, 2021 16:09
Bulma Example
<!doctype html>
<html lang="ja">
<head>
<title>Bulma Test</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
</head>
<body>
<button class="button is-primary" id="target" onclick="console.log('pressed')">target</button>
<button class="button is-danger" onclick="disableButton()">Diable</button>
<button class="button is-info" onclick="enableButton()">Enable</button>
@hidsh
hidsh / .bashrc-mymod.sh
Last active January 23, 2022 15:57
.bashrc に毎回付け足すのやその他のドットファイルなど
################################################
# unnbind key C-s, C-q in terminal
if [[ -t 0 ]]; then
stty stop undef
stty start undef
fi
# bind key Alt-h <- backward-kill-word
stty werase undef
@hidsh
hidsh / ubuntu-ver.sh
Last active July 9, 2022 08:12
Ubuntu のバージョンを調べるのに毎回5万回ほどググってさすがに嫌になったのでシェルスクリプトにしとく。
#!/usr/bin/sh
ubuntu_version() {
echo `cat /etc/lsb-release |grep -oP '(?<=").+(?=")'`
}
echo `ubuntu_version`
@hidsh
hidsh / com_tty.ps1
Last active October 1, 2021 06:44
Windows Terminal で COM ポートを使う
# Fully based on the following web pages:
# - https://qiita.com/yapg57kon/items/58d7f47022b3e405b5f3
# - https://kkamegawa.hatenablog.jp/entry/20070220/p2
# thx!
### 接続開始時のスクリプト ###
if([string]::IsNullOrEmpty($args[0])) {
$com_list = Get-WmiObject -Class Win32_PnPSignedDriver -Filter "FriendlyName LIKE '%COM%'" | Select-Object -Property FriendlyName
foreach($line in $com_list) {
@hidsh
hidsh / a_road_to_common_lisp_jp.md
Created March 30, 2021 03:46 — forked from y2q-actionman/a_road_to_common_lisp_jp.md
A Road to Common Lisp 翻訳

この文章は、 Steve Losh 氏の記事 "A Road to Common Lisp" の翻訳です。

原文はこちらです: http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/


A Road to Common Lisp (Common Lisp への道)

これまで、「最近のCommon Lispをどう学ぶとよいでしょう?」と助言を求めるメールをたくさん受け取ってきました。そこで私は、これまでメールやソーシャルメディアに投稿した全てのアドバイスを書き下すことにしました。これが誰かに有益ならば幸いです。