Skip to content

Instantly share code, notes, and snippets.

View ver-1000000's full-sized avatar
😍
Love you!

佐々木 匠太 ver-1000000

😍
Love you!
View GitHub Profile
@ver-1000000
ver-1000000 / capture-screen-by-slop-and-ffmpeg.sh
Created September 20, 2020 07:53
Linuxでffmpeg/slopを使って矩形選択スクリーンキャプチャするやつ
#!/bin/bash
PID=`pgrep -f "ffmpeg -f x11grab -s"`
if [ `echo $PID | wc -w` = 1 ];
then
tput bel
SLOP=$(slop -f "%x %y %w %h %g %i") || exit 1
read -r X Y W H G ID < <(echo $SLOP)
ffmpeg -f x11grab -s "$W"x"$H" -i :0.0+$X,$Y -f alsa -i pulse -fs 128M ~/Downloads/`date +%4Y-%m-%d_%I-%m-%S`.mp4
else
tput bel; sleep 0.1; tput bel;
@ver-1000000
ver-1000000 / Promiseをなんとかするパイプ.ts
Last active September 30, 2022 00:38
Angular custom pipe
import { ChangeDetectorRef, Pipe, PipeTransform } from '@angular/core';
import { toPromise } from 'なんかPromiseのライブラリとか';
/**
* PipeでPromiseを扱うときは、「impureパイプにして内部的に最新の値を持つ」みたいなアプローチを取るらしい。
* これは「Nullableなstringを受け取って、Promiseで遅延評価した結果を返す」パイプ。
*/
@Pipe({ name: 'hoge', pure: false })
export class HogePipe implements PipeTransform {