/** dayjs.tz.setDefault("Asia/Tokyo") している前提 */
/** 現在日時が 2024-04-22T08:00:00+09:00 のとき */
const date = new Date("2024-04-22T08:00:00+09:00")
// 現在日時(JST)
dayjs.tz().toDate() // 2024-04-21T23:00:00.000Z = 2024-04-22T08:00:00+09:00
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
markdown リンク | |
```js | |
javascript:(function(){window.prompt("リンク文字列作成DONE","["+document.title+"]("+location.href.replace(/\?.*$/, %27%27)+")");})(); | |
``` |
winget install
Google.Chrome
Microsoft.VisualStudioCode
Docker.DockerDesktop
Canonical.Ubuntu
Microsoft.WindowsTerminal
Discord.Discord
Amazon.Kindle
7zip.7zip
http://nodejs.osser.jp/server/nginx-max-performance/
- Nginxチューニング
- nginx最大限にスピードを出すために、設定パラメーターをチュニングしました。
- nginx設定例
user www-data;
例文を組み込んだAlfred Workflowを作りました: Alfred Git Commit Message Example
以下転載:
Componentのテストで頻出するパターンをまとめると、次のようになります。
- MicroTask(Promise.then)を実行させたい: fixture.whenStable, fakeAsync + flushMicrotasks, fakeAsync + tick
- MacroTaskの完了を待ちたい: fixture.whenStable
- MacroTask(但しタイマー系のみ)を実行したい: fakeAsync + tick
- EventTask(但しDOMのみ)を強制的に実行したい: fixture.query(...).triggerEventHandler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const routes: Routes = [ | |
{path: 'hoge', component: HogeComponent, data: {depth:1}}, | |
{path: 'foo', component: HogeComponent, data: {depth:2}}, | |
{path: 'bar', component: HogeComponent, data: {depth:3}}, | |
]; | |
... | |
@Component({ | |
template: ` | |
<!-- getDepth(outlet) --> |
Reactive Form sample
<textarea [formControl]="formControl" [maxlength]="length">
<span *ngIf="formControl.dirty"> dirty </span>
<button [disabled]="formControl.invalid">submit</button>
Custom Validator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://rxviz.com/v/7J2laXyo | |
var a = Rx.Observable | |
.interval(500) | |
.take(6) | |
.groupBy(x => x %2 === 0) | |
var b = a.flatMap(x => x) | |
var bb = a.mergeAll() | |
var sw = a.switchMap(x => x) | |
var exh = a.exhaustMap(x => x) |
NewerOlder