Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

mamemomonga mamemomonga

🏠
Working from home
View GitHub Profile
View _README.md

さくらのクラウドシェルでコピペ一発で「俺環境」を準備する

以下をコピペする

curl -L https://gist.githubusercontent.com/mamemomonga/4663dde65896402ca99a13d63afbeb64/raw/9045827bae598b3658f21204027ef0831d39358e/setup.sh | sudo bash
View bsky.md

bluesky cliクライアント bskyを試す

https://github.com/mattn/bsky

$ git clone git@github.com:mattn/bsky.git
$ cd bsky
$ go build
$ ./bsky login mamemomonga.bsky.social パスワード
$ ./bsky timeline
$ ./bsky post 'そろそろ眠くなってきたお'
@mamemomonga
mamemomonga / nod14yarn.md
Last active May 12, 2023 19:00
nodenvでnode14とyarnを入れる方法
View nod14yarn.md

nodenvでnode14とyarnを入れる方法

公式マニュアルにあるcorepackを使う方法だと上手くいかないので注意

	$ nodenv install 14.21.3
	$ nodenv local 14.21.3
	$ npm i -g yarn
	$ yarn -v
	1.22.19
@mamemomonga
mamemomonga / PostToBluesky.sh
Last active May 4, 2023 12:42
BlueSkyにシェルスクリプトで投稿する
View PostToBluesky.sh
#!/bin/bash
set -eu
# BlueSkyにシェルスクリプトで投稿する
# 必要なもの bash, curl, jq
# カレントディレクトリに session.json, message.json が生成されます。
# これらは秘匿情報が含まれている場合があります。ご注意ください。
# しのさんさん(@shino3.bsky.social), syuiさん(@syui.ai) ありがとう!
BKY_ID="ユーザ名.bsky.social"
@mamemomonga
mamemomonga / 162x2_and_595x1.ino
Last active April 8, 2023 11:15
74hc165 x2 と 74hc595 x1 のテスト
View 162x2_and_595x1.ino
#include <SPI.h>
// DIPスイッチとボタンの状態をUSBシリアル出力で表示する。ボーレートは115200
// DIPスイッチがONになっている数を7セグで表示する。またいずれかのボタンが押されたら小数点を表示する
// ビルトインLEDは LED_BUILTIN で定義されているが
// SCKと同じなので使わないこと
// 秋月電子のサンプルとはバイトオーダが逆なので注意
// これ: MSBFIRST / 秋月: LSBFIRST
@mamemomonga
mamemomonga / 74hc165.ino
Last active April 8, 2023 09:31
74HC165をつかったDIPスイッチの状態を読み込み
View 74hc165.ino
#define SRR_LD 21
#include <SPI.h>
// ビルトインLEDは LED_BUILTIN で定義されているが
// SCKと同じD13なので使わないこと
uint8_t pv;
void srrStart() {
SPI.begin();
@mamemomonga
mamemomonga / 半額寿司が買えなくて.txt
Last active March 26, 2023 04:31
半額寿司が買えなくて
View 半額寿司が買えなくて.txt
「半額寿司が買えなくて」
作詞:なすーん
作曲:まめも
歌:初音ミク
♪=160
イントロ: DGDG
[1]
D
@mamemomonga
mamemomonga / generator.pl
Last active December 27, 2022 06:05
すべてのファイルを ../files にコピーするシェルスクリプトを生成する。ただし、フォルダがない場合は新たに作成し、拡張子がhtm,html,js,css,txtの場合はgzip圧縮し、拡張子.gzを追加する。
View generator.pl
#!/usr/bin/perl
# すべてのファイルを ../files にコピーするシェルスクリプトを生成する。
# ただし、フォルダがない場合は新たに作成し、
# 拡張子がhtm,html,js,css,txtの場合はgzip圧縮し、拡張子.gzを追加する。
use strict;
use warnings;
use File::Find;
use feature 'say';
@mamemomonga
mamemomonga / convert.pl
Created December 11, 2022 00:22
KORG Gadget2 -> SP-404MK2 インポート補助ツール: このファイルと同じところに置かれた全てのWAVファイルをffmpegを通して1階層上のIMPORTフォルダに出力する
View convert.pl
#!/usr/bin/env perl
# ---------------------------------------------
# このファイルと同じところに置かれた全てのWAVファイルを
# ffmpegを通して1階層上のIMPORTフォルダに出力する
# ---------------------------------------------
use strict;
use warnings;
use Cwd 'getcwd';
use feature 'say';
use File::Basename;
@mamemomonga
mamemomonga / NJM11100.pl
Last active December 8, 2022 01:54
NJM11100 抵抗コンビ電卓
View NJM11100.pl
#!/usr/bin/env perl
# -----------------
use strict;
use warnings;
use feature qw(say);
use Data::Dumper;
# NJM11100F1
# NMD(JRC) https://www.nisshinbo-microdevices.co.jp/ja/products/ldo-linear-regulator/spec/?product=njm11100