This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.
Here's one way to set it up:
npm init -y
in your project folder (don't skip this step!)npm install terser
Now, to minify a file called like_button.js
, run in the terminal:
/* | |
As at the time of writing this Fluent ffmpeg-API for node.js has not been updated | |
for years and still does not support custom FFMPEG attributes, the only solutions | |
are either forking it or resorting to hacks like this one... | |
Please use it only when fluent does not support more complex arguments | |
(like generating multi-rendition HLS with all playlists in a single command) | |
NOTE: this does not support 'progress' event, but you can do it easily by | |
parsing 'stderr' event with extractProgress method from fluent-ffmpeg/lib/options.js |
#!/bin/sh | |
set -e | |
vendor/bin/phpunit | |
npm run prod | |
git add . | |
(git commit -m "Build frontend assets for deployment to production") || true | |
(git push) || true |
import useSWR, { Key, useSWRConfig } from 'swr' | |
import { useEffect } from 'react' | |
export const useCachedState = <T>(key: Key, fallbackData?: T) => { | |
/// cache is used for subsequent uses | |
const { cache } = useSWRConfig() | |
/// if initial data is empty, use value from cache | |
const initialData = fallbackData ?? cache.get(key) | |
const { data, mutate } = useSWR(key, { |