Skip to content

Instantly share code, notes, and snippets.

View masashi-sutou's full-sized avatar
🏠
Working from home

masashi-sutou masashi-sutou

🏠
Working from home
View GitHub Profile
@dhh
dhh / linux-setup.sh
Last active May 7, 2024 20:14
linux-setup.sh
# 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
@bouteillerAlan
bouteillerAlan / gist:ddb3055ae0b9b78710d15967079142f5
Last active October 15, 2021 23:52
next.js >> nginx prod w/ pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@azu
azu / TypeScriptの設定の良し悪し.md
Last active April 1, 2024 10:23
TypeScriptの設定の良し悪し

tsconfig.json の設定についてのメモ書きです。

Node.jsのバージョンごとの設定

target は 変換後のコードのECMAScriptバージョンを指定する たとえば、Node.js 14はES2020をサポートしている。そのため、Node.js 14向けのコード(サーバなど)ならtarget: "ES2020"を指定することで、余計なTranspileが省かれててコードサイズや実行時間が最適化される。

@slightfoot
slightfoot / main.dart
Last active August 24, 2022 13:51
Firestore Chat List Example - by Simon Lightfoot - 07/05/2020
// 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:
@mono0926
mono0926 / overflow_detectable_text.dart
Last active May 16, 2019 13:13
通常通り文字を表示しつつ、表示しきれたかどうかの結果を通知してくれるText Widget
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:
@mono0926
mono0926 / main_counter.dart
Created April 27, 2019 02:09
ValueNotifier/ValueListenableBuilderの最小構成のサンプル
import 'package:flutter/material.dart';
const title = 'ValueListenableBuilder Demo';
void main() => runApp(App());
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@mbleigh
mbleigh / README.md
Last active September 25, 2020 04:26
Automate the deletion of old Firebase Hosting versions.

Firebase Hosting Version Cleanup

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

Usage

node cleanupVersions.js [commit]

import UIKit
final class KeepingContentOffsetCollectionViewLayout : UICollectionViewFlowLayout {
private var oldOffset: CGFloat?
typealias Completion = () -> Void
/// Perform passed closure with keeping current contentOffset.
///
@motokiee
motokiee / itc_status_slack_notification.gs
Last active November 13, 2023 04:23
Post iTunes Connect Status to Slack with Gmail using Google Apps Script
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();