ラップトップPCを修理に出してまっさらな状態にしたので、 新しくLinux環境を構築し直しました。
sda1 win7システム/リカバリ領域
sda2 win7
sda4 メーカーリカバリ領域?
みたいな構成の500GBHDDに、win7についてるパーティショニングツールでsda2を縮小、
| 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 { | 
| #!/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; | 
| const optimalFontSize = (word, r, fontFamily, fontWeight) => { | |
| const text = document.createElementNS('http://www.w3.org/2000/svg', 'text') | |
| text.textContent = word | |
| text.setAttributeNS(null, 'font-family', fontFamily) | |
| text.setAttributeNS(null, 'font-weight', fontWeight) | |
| const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg') | |
| svg.appendChild(text) | |
| document.body.appendChild(svg) | |
| let ok = 0 | |
| let ng = 100 | 
| /** | |
| * {@link https://music.youtube.com/library/uploaded_albums}を開いてブラウザのコンソールログで実行すると | |
| * アルバムをどんどん削除していくスクリプトです。 | |
| * | |
| * なんだかときどき「クリックしてもアルバムの削除が実行されない」自体に陥ってしまうので、 | |
| * そういうときは手動で「Youtube Music/アップロード」のドロップダウンを開いて、再選択する必要があります。 | |
| * (頑張ればここもケアできるけどめんどくさくてやめた) | |
| * | |
| * - ※ 本スクリプトを実行した際の損失などについて、製作者は一切責任を負いません。 | |
| */ | 
| /** | |
| * {@param} url 取得したいDOMを返すURL | |
| * {@param} mineType 取得したいDOMの[MINE TYPE]{@link https://developer.mozilla.org/ja/docs/Web/API/DOMParser#Argument02} | |
| * | |
| * url指定するとRSSフィードとかhtmlとかxmlとかが取得できるやつ。 | |
| * | |
| * - 取得したいDOMと別ドメインで実行すると、CORSポリシーで弾かれるのでその辺注意 | |
| */ | |
| const fetchDOM = async (url, mimeType = 'application/xml') => { | |
| let body = ''; | 
| h = []; | |
| n = ({ nextElementSibling: e }) => { if (e) { e.scrollIntoView(); h.push((a => `${a.href} ${a.innerText}`)(e.shadowRoot.querySelector('a'))); setTimeout(() => n(e), 100); } else { console.log(h.filter((x, i) => h.indexOf(x) == i).sort().join('\n')); } }; | |
| n(document.querySelector("#history-app").shadowRoot.querySelector("#history").shadowRoot.querySelector("history-item")); | 
| #!/bin/bash | |
| WEBHOOK_URL="https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/xxxxxxxxxxxxxxxxxxxxxxxx" | |
| USERNAME="MinecraftLogger" | |
| CHANNEL="#minecraft" | |
| ICON=":minecraft:" | |
| TEXT=`echo "$*" | sed 's/<\(\w\+\)>/<:\1:>/'` | |
| TEXT=`echo "$TEXT" | sed 's/Stopping server/サーバーを *終了* しています/'` | |
| TEXT=`echo "$TEXT" | sed 's/Starting minecraft server/サーバーを *起動* しています: /'` | 
| import { Pipe, PipeTransform } from '@angular/core'; | |
| /** | |
| * `{ id: number, name: string }[]`のような、ユニークな値を持つオブジェクトの配列に対して、 | |
| * 簡単に{@link https://angular.io/api/core/TrackByFunction TrackByFunction}を設定するためのパイプ。 | |
| * | |
| * @example | |
| * <!-- `{ id: number, name: string }[]` --> | |
| * <div *ngFor="let item of items; trackBy: 'id' | keyTrackBy">{{ item.id }}: {{ item.name }}</div> | |
| * | 
| d = document; a = d.createElement('pre'); d.body.appendChild(a); a.style = 'position:fixed;resize:both;top:200px;height:200px;width:400px;overflow:auto;white-space:pre-wrap;background:#46486787;z-index:1'; q = (x) => d.querySelectorAll(x)[0]; m = q('.messagelist'); t = ''; o = new MutationObserver(_ => { tt = ((q('.messagerow')||{}).innerText||'').trim(); if (tt && t != tt) { a.innerText = `[${new Date().toLocaleString('ja-JP')}] ${tt}\n\n${a.innerText}`; t = tt; } }); o.observe(m, { childList: true }) | 
ラップトップPCを修理に出してまっさらな状態にしたので、 新しくLinux環境を構築し直しました。
sda1 win7システム/リカバリ領域
sda2 win7
sda4 メーカーリカバリ領域?
みたいな構成の500GBHDDに、win7についてるパーティショニングツールでsda2を縮小、