Skip to content

Instantly share code, notes, and snippets.

- https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/
- https://www.npmjs.com/package/cordova-res
config.xml
resources/icon.png
resources/splash.png
ルートに配置してcordova-resコマンド実行
プラットフォームごとの画像が自動生成され、config.xmlも自動で書き換わる
ただ、プラットフォーム毎に生成された画像がコピーされてない
@Restoration
Restoration / flex.md
Created January 17, 2020 00:28
Flex-box: Align last row to grid
create-react-app のデフォルトからあまり触っていないが、以下の rules を弄っている。
no-default-export: named export を強制するため true にしている
interface-name: 大文字 I から始まる interface 名を禁止
ordered-imports: インポート順をアルファベット順にして探しやすいように true
jsx-no-lambda: Query Component pattern などで使うので false
object-literal-sort-keys: object の key はアルファベット順よりも重要度で並べたり、分類ごとにまとめたりしたいので false
prettier: tslint-plugin-prettier をインストール($ yarn add -D tslint-plugin-prettier)し "rulesDirectory": ["tslint-plugin-prettier"] を追加して true にするとプロジェクトの .prettierrc(.json) が効くようになる
メンバーの多いプロジェクトでは、さらに必要に応じてrulesを追加したり無効化したりする
@Restoration
Restoration / index.js
Created December 28, 2019 21:58
Tinder自動スワイプスクリプト
auto = setInterval(function(){
let elem= document.getElementsByClassName("recsGamepad__button");
elem[3].click()
},500);
@Restoration
Restoration / tsconfig.json
Created December 20, 2019 01:06
tsconfig日本語訳
{
"compilerOptions": {
/* 基本オプション */
"target": "es5", /* ECMAScriptのターゲットバージョンを指定します: 'ES3'(デフォルト), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018'または 'ESNEXT' */
"module": "commonjs", /* モジュールコード生成: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015',または 'ESNext'を指定します。 */
// "lib": [], /* コンパイルに含めるライブラリファイルを指定します。 */
// "allowJs": true, /* javascriptファイルをコンパイルできるようにします。 */
// "checkJs": true, /* .jsファイルのエラーを報告します。 */
// "jsx": "preserve", /* JSXコード生成を指定する: 'preserve', 'react-native',または 'react'。 */
// "declaration": true, /* 対応する '.d.ts'ファイルを生成します。 */
@Restoration
Restoration / yup.md
Last active December 10, 2019 05:51

We’ve been using yup to validate a JavaScript form, and found ourselves facing a common problem when a user signs up for a service:

How do we ensure a user’s email matches their email confirmation?

yup’s test function helped us find a solution. It’s documented like this:

mixed.test(name: string, message: string, test: function) Text test takes a name, a message to show on failure, and a function that returns a boolean. We paired this with the email we get from our parent.

struct tm {
int tm_sec; /* 秒 (0-60) */
int tm_min; /* 分 (0-59) */
int tm_hour; /* 時間 (0-23) */
int tm_mday; /* 月内の日付 (1-31) */
int tm_mon; /* 月 (0-11) */
int tm_year; /* 年 - 1900 */
int tm_wday; /* 曜日 (0-6, 日曜 = 0) */
int tm_yday; /* 年内通算日 (0-365, 1 月 1 日 = 0) */
int tm_isdst; /* 夏時間 */
import { NextPage } from 'next'
import { withRouter } from 'next/router'
import { WithRouterProps } from 'next/dist/client/with-router'
interface Props {
books: Book[]
}
const Index : NextPage<WithRouterProps & Props> = () => {
return <div>
React Hook “useState” is called in function “app” which is neither a React function component or a custom React Hook function
React Function ComponentかCustom Hooksを使用する必要がある
関数名の最初の文字を大文字にする
もしくはuseをしようした名前に変更する
https://stackoverflow.com/questions/55846641/react-hook-usestate-is-called-in-function-app-which-is-neither-a-react-funct
React Hook “useState” is called in function “app” which is neither a React function component or a custom React Hook function
React Function ComponentかCustom Hooksを使用する必要がある
関数名の最初の文字を大文字にする
もしくはuseをしようした名前に変更する