- added to .gitignore
- any new file
- track by
git add filename/pattern
| let script = document.createElement('script'); | |
| script.src = "https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"; | |
| script.onload = function() { | |
| // Step 1: Select the canvas element | |
| const canvas = document.querySelectorAll('canvas')[1]; // Adjust selector if needed | |
| // Step 2: Convert canvas to image | |
| const imgData = canvas.toDataURL('image/png'); | |
| // Step 3: Create PDF and add image |
| version: "3.9" | |
| services: | |
| web: | |
| build: | |
| context: . | |
| target: image-dev | |
| restart: on-failure | |
| ports: | |
| - 9000:9000 | |
| volumes: |
| FROM golang:1.16.4-alpine as base | |
| WORKDIR /app/go | |
| COPY . . | |
| RUN go mod download | |
| FROM base as image-dev | |
| RUN go get github.com/cosmtrek/air | |
| EXPOSE 9000 | |
| CMD $(go env GOPATH)/bin/air |
| docker run --rm -it redis redis-cli -h HOST -p PORT -a SERVER_PASSWORD | |
| # It should open a shell | |
| HOST:PORT > ping | |
| PONG |
| # Replace 1gb with a suitable value depending on the server | |
| maxmemory 1gb | |
| # Setting an eviction policy is very helpful to free memory when required. | |
| maxmemory-policy volatile-afu |
| appendonly yes # set no to disable aof | |
| appendfsync everysec # tells the OS to write data on disk instead of waiting for more data in the buffer. | |
| # Available options for appendfsync are | |
| # always : sync after every write. Slowest, safest | |
| # everysec : sync only once every second. Compromise | |
| # no : don't sync, just let the OS flush data as it wants. Faster, risky |
| docker run --rm -d --name my-redis \ | |
| -p 6379:6379 \ | |
| -v $(pwd)/data:/data \ | |
| -v $(pwd)/redis.conf:/usr/local/etc/redis/redis.conf \ | |
| redis redis-server /usr/local/etc/redis/redis.conf |
| #!/bin/bash | |
| # DB info | |
| old_db="source_database_name" | |
| # Connection info | |
| uri="source_db_connection_string" | |
| to_uri="target_db_connection_string" | |
| # Storage info |
| try { | |
| if ("function" === typeof importScripts) { | |
| importScripts( | |
| "https://storage.googleapis.com/workbox-cdn/releases/3.5.0/workbox-sw.js" | |
| ); | |
| // Global workbox | |
| if (workbox) { | |
| // console.log("Workbox is loaded"); |