- フォントは Web サイトの印象に直結するため、一概にこれが良いとは言えない。
- 特にこれと言った指定がされていない場合は
font-family: sans-serifのみで良い。- Windows 11/10 では 2025 年のアップデートにより Noto Sans JP が標準搭載された。色々と問題があった游ゴシックの呪縛から解放されたのは大きい。
- Android はメーカーにより削除されている可能性はあるが、そうでない場合は原則的に Noto Sans CJK JP が適用される。
- Mac/iOS はヒラギノ角ゴ ProN が適用される。
- アップデートによるフォントの変更の懸念はあるものの、ディスクリシアの方々は UD デジタル教科書体などの読みやすいフォントを設定している可能性があるため、アクセシビリティの観点では
font-family: sans-serifの指定を推奨する。
This file contains hidden or 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
| //Hook used to determine if it is a component's first mount | |
| //Useful to put in useEffect functions that share data calls but not all the same calls | |
| import { useRef, useEffect } from 'react' | |
| //https://stackoverflow.com/a/56267719/3058839 | |
| export const useIsMount = () => { | |
| const isMountRef = useRef(true) | |
| useEffect(() => { | |
| isMountRef.current = false |
This file contains hidden or 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
| expo init $1 | |
| cd $1 | |
| yarn add @types/expo eslint eslint-config-react-native-wcandillon --dev | |
| mv App.js App.tsx | |
| curl -O https://gist.githubusercontent.com/wcandillon/10f40b913f1c63f357169b97473f9eb2/raw/45c677856ae512cbb8db41308de72d149fded5b4/tsconfig.json | |
| curl -O https://gist.githubusercontent.com/wcandillon/f734fb532bffec0abc436749dd46c4bf/raw/c33de2df4b4fb4dec0b6f44e6aa1ceb5d7004141/.eslintrc |
This file contains hidden or 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
| // 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
| const axios = require('axios'); // promised based requests - like fetch() | |
| function getCoffee() { | |
| return new Promise(resolve => { | |
| setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
| }); | |
| } |
This file contains hidden or 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
| // getComponent is a function that returns a promise for a component | |
| // It will not be called until the first mount | |
| function asyncComponent(getComponent) { | |
| return class AsyncComponent extends React.Component { | |
| static Component = null; | |
| state = { Component: AsyncComponent.Component }; | |
| componentWillMount() { | |
| if (!this.state.Component) { | |
| getComponent().then(Component => { |
This file contains hidden or 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
| // non-async | |
| it('Correctly makes AJAX request in `componentDidMount`', () => { | |
| nock('https://api.github.com') | |
| .get('/users') | |
| .reply(200, [ | |
| { 'name': 'Reign', 'age': 26 } | |
| ]); | |
| wrapper = mount(<UsersListComponent />); | |
This file contains hidden or 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
| var debug = process.env.NODE_ENV !== "production"; | |
| var webpack = require('webpack'); | |
| module.exports = { | |
| context: __dirname, | |
| devtool: debug ? "inline-sourcemap" : null, | |
| entry: "./js/scripts.js", | |
| output: { | |
| path: __dirname + "/js", | |
| filename: "scripts.min.js" |
This file contains hidden or 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
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
NewerOlder