next.js, nginx, reverse-proxy, ssl
$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt
# CLI | |
sudo apt update -y | |
sudo apt install -y \ | |
git curl \ | |
docker.io docker-buildx \ | |
build-essential pkg-config autoconf bison rustc cargo clang \ | |
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \ | |
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \ | |
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \ | |
rbenv apache2-utils |
tsconfig.json
の設定についてのメモ書きです。
target は 変換後のコードのECMAScriptバージョンを指定する
たとえば、Node.js 14はES2020をサポートしている。そのため、Node.js 14向けのコード(サーバなど)ならtarget: "ES2020"
を指定することで、余計なTranspileが省かれててコードサイズや実行時間が最適化される。
// MIT License | |
// | |
// Copyright (c) 2020 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
import 'package:flutter/scheduler.dart'; | |
import 'package:flutter/widgets.dart'; | |
typedef OverflowDetector = void Function(bool overflowed); | |
class OverflowDetectableText extends StatelessWidget { | |
const OverflowDetectableText( | |
this.data, { | |
Key key, | |
@required this.style, |
import 'package:flutter/widgets.dart'; | |
import 'package:rxdart/rxdart.dart'; | |
/// ライフサイクル監視 | |
/// | |
/// ``` | |
/// final observable = LifeCycleObservable(); | |
/// final subscription = observable.state.listen((state) { | |
/// switch (state) { | |
/// case AppLifecycleState.resumed: |
import 'package:flutter/material.dart'; | |
const title = 'ValueListenableBuilder Demo'; | |
void main() => runApp(App()); | |
class App extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This is a simple utility script for cleaning up Firebase Hosting versions, leaving a specified number of versions remaining. This is primarily done to conserve storage usage, but may have other uses.
USE AT YOUR OWN RISK. NO WARRANTY IS PROVIDED. THIS SCRIPT DOES DELETE STUFF PERMANENTLY
node cleanupVersions.js [commit]
import UIKit | |
final class KeepingContentOffsetCollectionViewLayout : UICollectionViewFlowLayout { | |
private var oldOffset: CGFloat? | |
typealias Completion = () -> Void | |
/// Perform passed closure with keeping current contentOffset. | |
/// |
var mailAddress = "YOUR_EMAIL_ADDRSS"; | |
var slackToken = "SLACK_TOKEN"; | |
var searchMailQuery = 'SEARCH_QUERY'; // example: '[from:no_reply@email.apple.com YOUR_APP_NAME]'; | |
var slackChannelId = "SLACK_CHANNEL_ID"; | |
function getAttachment(message) { | |
var subject = message.getSubject(); | |
var body = message.getPlainBody(); | |