macで閉じてもスリープしない

//スリープを無効 sudo pmset disablesleep 1 //スリープを有効 sudo pmset disablesleep 0

git

flowchart BT subgraph ローカル環境 subgraph remoteBranch["リモート追跡ブランチ"] origin/hoge upstream/hoge end subgraph localRepo ["ワーキングディレクトリ"] end subgraph index["インデックス (ステージング)"] ローカルブランチ end subgraph al…

ffmpeg 音声ファイルに黒背景をつけて動画として書き出し

FILE_NAME="inputfile.m4a" && ffmpeg -f lavfi -i color=c=black:s=480x360:d=10 -i ${inputfile} -c:v libx264 -c:a aac -strict experimental -t "$(ffprobe -i ${inputfile} -show_entries format=duration -v quiet -of csv='p=0')" $(echo $inputfile …

BIMモデルを利用したLPを作ってみる② styled-components導入編

単純にstyled-componentsを'edgesout' とエラーが出たのでLTSバージョンをインストール npm i -D styled-components@5.3.10 Typescript用の型定義もインポート npm i -D @types/styled-components@5.1.26

BIMモデルを利用したLPを作ってみる① Next.js + Storybook + Cloudflare編

プロジェクト作成 next バージョン 13.4.2 storybook バージョン 7.0.11 npx create-next-app@latest --ts npm i sb@latest type nextjs npm sb init Storybookのサンプル内のエラー修正 eslintで警告されたエスケープ処理を修正 "args" of child …

yabai&skhd設定

# focus window alt - x : yabai -m window --focus recent alt - h : yabai -m window --focus west alt - j : yabai -m window --focus south alt - k : yabai -m window --focus north alt - l : yabai -m window --focus east # swap window shift + alt…

javascript chromeでの並行ダウンロード制限(10まで)以上のダウンロード

const link = document.createElement('a'); document.body.appendChild(link); //Promiseを返却して処理を止める function pause() { return new Promise( (resolve, reject) => { setTimeout(resolve, 1000); } ); } const files = [ "file1", "file2", "f…

スプレッドシート

=query('シート1'!A:D,"where D like '"&A1&"%'")

Unity 文字列補完のエスケープ処理

"ダブルクオーテーション,{}中括弧はエスケープ対象 'シングルクオーテーションはエラー対象 var hoge = "HOGE" $"(function(){{ console.log(/"{hoge}/") }})();" ↓ ↓ (function(){ console.log("HOGE") })();

cURL

-X HTTPプロトコルを指定 -I レスポンスヘッダーのみ表示 -d クエリをつけて送信 curl -X POST http://localhost:3000/users -d name=fugafuga //{name:"fugafuga"}をpost

cURL

-X HTTPプロトコルを指定

Githubから特定のファイルをダウンロード

githubページを開いた状態で.(ピリオド)キーでVSCodeモードを開く

UnityWEBGL ←→Javascript

WEBGLの全画面表示 TemplateData>style.css #unity-container.unity-desktop {width: 100%; height: 100%} #unity-canvas { background: #231F20; width: 100%; height: 100%} UnityC# から Javascript関数を呼び出す Javascriptプラグインを作成 Assets>Plu…

AWS CLI フォルダごとダウンロードする

AWS

カレントディレクトリにDirectoryNameの内容を全てコピーする aws s3 cp s3://BucketName/DirectoryName/ ./ --recursive --profile hoge

UE4 Blackmagicのボードから映像の入力

UE4

MediaBundleをコンテンツツリーに追加 Blackmagic Desktop Video Setupで解像度、プログレッシブorインターレース、フレームレートを確認 MediaBundleで上と同じ動画設定を設定 //参考URL https://youtu.be/MoPA3kws7BE

ターミナル タイマー

sleep 5000; say finished; afplay <Path>;</path>

MySQL(オラクルインストール版) rootのパスワードをリセット(M1)

MySQLのサーバー停止後 sudo mysqld_safe --skip-grant-tables 別ターミナルを立ち上げて mysql -u root UPDATE mysql.user SET authentication_string=null WHERE User='root'; FLUSH PRIVILEGES; exit; MySQLのサーバーを再起動して (オラクルインストール…

AWS CORS対応

API GatewayからリソースのCORS有効化 Jsonでデータをやり取りする場合はJSON.stringify(data)でJSON文字列にしないと content-typeで弾かれてCORSエラーとなるため分かりにくい

スプレッドシート セルの絶対参照

=B1&D2 // 相対参照 =$B1&D2 // Bの列のみ絶対参照 =B$1&D2 // Bの行のみ絶対参照 =$B$1&D2 // Bの行と列どちらも絶対参照 //参考URL https://trinity.jp/181511/

ターミナルでシェルスクリプトが実行できない (2022/7/5 m1 MacBookAir)

chmodにより実行権限を付与しても以下エラーにより実行できない zsh: permission denied: ./ bushコマンドでは実行可能 bush hoge.sh

VSCode 自作スニペット

File>Preference>ConfigureUserSnippets "Arrow function": { "scope": "javascript,typescript", "prefix": "af", "body": [ "($1) => {$2}" ] }, scopeパラメータで適宜言語を加える javascriptreact,typescriptreact等 //参考URL http://www.natural-scie…

VSCode 自作スニペット

File>Preference>ConfigureUserSnippets "Arrow function": { "scope": "javascript,typescript", "prefix": "af", "body": [ "($1) => {$2}" ] },

VSCodeでNodeデバッグ環境

デバッグの環境設定からlaunch.jsonを設定 { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version…

シェルスクリプト 変数と文字列処理

#suffixを削除 ${var#suffix} #prefixを削除 ${var%prefix} //参考URL https://qiita.com/yuyuchu3333/items/8d043d781bc8b343e108

シェルスクリプト 画像をリサイズ

sips -Z 512 $f -o "${f%.jpg}_new.jpg" //参考URL https://stupiddog.jp/note/archives/543

シェルスクリプト

指定ディレクトリ内のファイルの一括処理 for f in ./hoge/*; do # ファイル一つ毎の処理 echo "file: $f" done //参考URL https://programwiz.org/2021/05/09/shellscript-in-bash-how-to-files-loop/

mixamo とplaycanvasの連携

アニメーションデータがmixamo.comで重複する場合、識別できなくなる場合がある 一度他プロジェクトにインポート後にリネームしたものをメインプロジェクトへコピペ

スプレッドシート 条件付き書式

=FIND("◯",A1)>0 ◯の文字を含む =countif($F2, "◯") F列に◯の文字を含む =countif($F2, "<>◯") F列に◯の文字を含まない =countif($F2, "" & $A$1 & "") F列にA1にある文字を含まない //参考URL https://web-generalist.com/spreadseat-custom-formula/

コマンドプロンプト 特定の拡張子のファイルを削除 

del /s *.hoge ※/s サブディレクトリ含めて処理する //参考URL https://qiita.com/erik_t/items/16c1e7409a5ddcb9f55e

Emmet

div#div1>div#div2 table>(tr>th+td)*7 div[attribute="test"] div{test} div{item-$}*5 Emmetが他のスニペットと競合して機能しない場合、設定ファイルを書き換える //参考URL https://taiyosite.com/vscode-emmet/ https://qiita.com/rei67/items/f19983a7…