Lets say we have a large Redux State object which looks like this...
interface State {
stockMarketData: {
[stockTicker: string]: {
import urllib.parse | |
import urllib.request | |
url = 'http://example.com' | |
values = {'name': 'nesffer', | |
'query': 'python'} | |
headers = {'Content-Type': 'text/plain'} | |
data = urllib.parse.urlencode(values).encode('utf-8') | |
req = urllib.request.Request(url, data, headers) | |
f = urllib.request.urlopen(req) |
//.eslintrc | |
{ | |
"env": { | |
"browser": true, | |
"es6": true, | |
"commonjs": true | |
}, | |
"plugins": ["react"], | |
"extends": [ |
// Since ES6 Map()'s' retain their order of insertion, it can sometimes be useful to get the last item or value inserted: | |
export const getLastItemInMap = map => Array.from(map)[map.size-1] | |
export const getLastKeyInMap = map => Array.from(map)[map.size-1][0] | |
export const getLastValueInMap = map => Array.from(map)[map.size-1][1] | |
// Obviously getLastKey and getLastValue can reuse getLastItem, but for maximum portability I opted for verbosity. |
import { setupTypeOrmTestConnection } from '../integrationSetup'; | |
beforeAll(async () => { | |
console.log('AFTER ENV SETUP START'); | |
global.testConn = await setupTypeOrmTestConnection(+process.env.TEST_PG_PORT); | |
console.log('AFTER ENV SETUP DONE'); | |
}); | |
afterAll(async () => { | |
console.log('AFTER ENV TEARDOWN START'); |
2019 update: this essay has been updated on my personal site, together with a followup on how to get started
2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!
If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.
You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
let callCount = -1 | |
let states = [] | |
function useState(initValue) { | |
const id = ++callCount | |
if (states[id]) return states[id] |
tsconfig.json
の設定についてのメモ書きです。
target は 変換後のコードのECMAScriptバージョンを指定する
たとえば、Node.js 14はES2020をサポートしている。そのため、Node.js 14向けのコード(サーバなど)ならtarget: "ES2020"
を指定することで、余計なTranspileが省かれててコードサイズや実行時間が最適化される。
AWS 학습 링크집 시리즈