(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| const Chosed = (props) => { | |
| const elmt = React.useRef() | |
| React.useLayoutEffect(()=>{ | |
| const $elmt = $(elmt.current) | |
| const handleChange = (e) => { | |
| props.onChange(e.target.value); | |
| } | |
| $elmt.chosen() |
| { | |
| "scripts": { | |
| "build": "npm run build:es2015 && npm run build:esm && npm run build:cjs && npm run build:umd && npm run build:umd:min", | |
| "build:es2015": "tsc --module es2015 --target es2015 --outDir dist/es2015", | |
| "build:esm": "tsc --module es2015 --target es5 --outDir dist/esm", | |
| "build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs", | |
| "build:umd": "rollup dist/esm/index.js --format umd --name YourLibrary --sourceMap --output dist/umd/yourlibrary.js", | |
| "build:umd:min": "cd dist/umd && uglifyjs --compress --mangle --source-map --screw-ie8 --comments --o yourlibrary.min.js -- yourlibrary.js && gzip yourlibrary.min.js -c > yourlibrary.min.js.gz", | |
| } | |
| } |
| /* | |
| curl -X POST -H "Content-Type: application/json" -d '{"children":[{"id":"0"},{"id":"1"}],"childrenById":{"2":{"id":"2"}}}' http://localhost:8080/api/immutables | |
| */ | |
| @RestController | |
| @RequestMapping("/api/lombok") | |
| public class LombokController { | |
| @RequestMapping(method = RequestMethod.GET) | |
| public Parent get() { |
| import React from 'react' | |
| import { observer } from 'mobx-react' | |
| function ArtistList({ uiState: { artistData } }) { | |
| const { data } = artistData; | |
| if ( !data || !data.artists || !data.artists.length ) { | |
| return <div>No artists bruh.</div> | |
| } | |
| const { artists } = data | |
| return ( |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| package jmodern; | |
| import com.codahale.metrics.*; | |
| import com.codahale.metrics.annotation.*; | |
| import com.fasterxml.jackson.annotation.*; | |
| import com.google.common.base.Optional; | |
| import feign.Feign; | |
| import feign.jackson.*; | |
| import feign.jaxrs.*; | |
| import io.dropwizard.Application; |
| docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
CSS selector minification is a missed opportunity of saved bytes. Currently, Google uses it but not much beyond that.
The concept is change .box to .b and <div class="box"> to <div class="b">.
There is room for issues with JavaScript so that should be treated as a nice-to-have and be conservatively avoided.
To convert HTML and CSS, it would be a 2 step process:
| public static String toISO8601UTC(Date date) { | |
| TimeZone tz = TimeZone.getTimeZone("UTC"); | |
| DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); | |
| df.setTimeZone(tz); | |
| return df.format(date); | |
| } | |
| public static Date fromISO8601UTC(String dateStr) { | |
| TimeZone tz = TimeZone.getTimeZone("UTC"); | |
| DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); |
Block encapsulates a standalone entity that is meaningful on its own.
While blocks can be nested and interact with each other, semantically they remain equal; there is no precedence or hierarchy.
Holistic entities without DOM representation (such as controllers or models) can be blocks as well.