By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
| //Example 1 - Calculate average value of an array (transform array into a single number) | |
| var scores = [89, 76, 47, 95] | |
| var initialValue = 0 | |
| var reducer = function (accumulator, item) { | |
| return accumulator + item | |
| } | |
| var total = scores.reduce(reducer, initialValue) | |
| var average = total / scores.length | |
| /*Explain about function |
| cd fonts | |
| mv *.ttf /usr/share/fonts/truetype | |
| cd /usr/share/fonts/truetype | |
| mkfontscale | |
| mkfontdir | |
| fc-cache | |
| xset fp rehash |
| Mute these words in your settings here: https://twitter.com/settings/muted_keywords | |
| ActivityTweet | |
| generic_activity_highlights | |
| generic_activity_momentsbreaking | |
| RankedOrganicTweet | |
| suggest_activity | |
| suggest_activity_feed | |
| suggest_activity_highlights | |
| suggest_activity_tweet |
| # requires: 256 color terminal | |
| /script install iset.pl | |
| /script install buffers.pl | |
| /script install colorize_nicks.py | |
| /set weechat.look.buffer_notify_default message | |
| /set weechat.look.color_nick_offline on | |
| /set weechat.look.prefix_action " •" | |
| /set weechat.look.prefix_join "▬▶" |
| " _ _ " | |
| " _ /|| . . ||\ _ " | |
| " ( } \||D ' ' ' C||/ { % " | |
| " | /\__,=_[_] ' . . ' [_]_=,__/\ |" | |
| " |_\_ |----| |----| _/_|" | |
| " | |/ | | | | \| |" | |
| " | /_ | | | | _\ |" | |
| It is all fun and games until someone gets hacked! |
| /** | |
| * General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts. | |
| * | |
| * Note that this uses an older fork of stable-diffusion | |
| * with the 'txt2img.py' script, and that script was modified to | |
| * support the --outfile command. | |
| */ | |
| var { spawn, exec } = require("child_process"); | |
| var path = require("path"); |
Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.
You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.
You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)
Don't like Next? Here's how to do the same in Gatsby.