Atomic CSS Icons and Redis Usage
Recent News
-
Pray for world peace!
-
Xiaomi’s self-developed “MIOS” is trending again. Is MIUI 14 the final version? –Script Home
-
Microsoft has announced that VBScript is deprecated and listed in its deprecated features for Windows clients. In future versions of Windows, VBScript will be an optional feature, and will eventually be removed from Windows. –https://www.theregister.com/2023/10/10/microsoft_says_vbscript_will_be/
Using UnoCSS Icons
Let’s see the effect first:
-
Installation pnpm add -D @unocss/preset-icons @iconify-json/[the-collection-you-want]
-
Create uno.config.ts in the root directory
// uno.config.ts
import { defineConfig } from 'unocss'
import presetIcons from '@unocss/preset-icons'
export default defineConfig({
presets: [
presetIcons({
/* options */
})
// ...other presets
]
})
- To load an iconify collection, you should use @iconify-json/[the-collection-you-want] instead of @iconify/json, because the json file is too large. Just install what you need, don’t install everything (pnpm add -D @iconify/json).
Installing Redis with Docker
Official website:
- Production environment:
docker run -d –name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest
This image only contains the Redis Stack server and does not include the RedisInsight tool. This container is suitable for production deployments where you may not need RedisInsight for visual management, but only the Redis Stack server to support your application.
- Test and development environment:
docker run -d –name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
This image contains the Redis Stack server and the RedisInsight tool. This is a container that integrates the Redis Stack server and RedisInsight, suitable for local development environments. RedisInsight is a tool for visually managing Redis data, so you can use the built-in RedisInsight to visualize your data for development and debugging during local development.
- Connect using redis-cli
docker exec -it redis-stack redis-cli
- Persistence, add a local directory
docker run -v /local-data/:/data redis/redis-stack:latest
- Use a custom configuration
docker run -v pwd
/local-redis-stack.conf:/redis-stack.conf -p 6379:6379 -p 8001:8001 redis/redis-stack:latest