Setup a folder inside a repo with a specific commit of that repo.
git worktree add [-f] [--detach] [--checkout] [--lock] [-b ] []
Setup a folder inside a repo with a specific commit of that repo.
git worktree add [-f] [--detach] [--checkout] [--lock] [-b ] []
| name | description |
|---|---|
Logging Best Practices |
Use before implementing logs in a medium to large scale production system. |
This skill is adpated from "Logging sucks. And here's how to make it better. by Boris Tane.
When helping with logging, observability, or debugging strategies, follow these principles:
| COPY PASTE |
| #no auth | |
| VICTORIA_LOGS_ENDPOINT=http://localhost:9428/insert/loki/api/v1/push | |
| #with basic auth | |
| VICTORIA_LOGS_ENDPOINT=http://admin:password@localhost:9428/insert/loki/api/v1/push | |
| VICTORIA_LOGS_LABELS=app=Laravel,env=production | |
| VICTORIA_LOGS_TIMEOUT=1.5 |
| # convert .mov to mp4 | |
| ffmpeg -y -i "vidio.mov" -c:v libx264 -crf 22 -preset veryfast -pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart "vidio.mp4" | |
| # convert .mp4 to .gif and make the video 2x faster | |
| ffmpeg -i "video.mp4" -i palette.png -lavfi "setpts=0.5*PTS,fps=15,scale=800:-1:flags=lanczos[x];[x][1: | |
| v]paletteuse" -y video.gif |
| { | |
| "editor.minimap.maxColumn": 40 | |
| } |
| #remove existing one | |
| sudo dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine | |
| #setup repo | |
| sudo dnf -y install dnf-plugins-core | |
| sudo dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo | |
| #install the engine | |
| sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
| #start engine |
| To enable PHP in Apache add the following to httpd.conf and restart Apache: | |
| LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so | |
| <FilesMatch \.php$> | |
| SetHandler application/x-httpd-php | |
| </FilesMatch> | |
| Finally, check DirectoryIndex includes index.php | |
| DirectoryIndex index.php index.html |
| import { NextApiRequest, NextApiResponse } from 'next'; | |
| let callbackURL = 'http://localhost:9000/api/v1/auth/google/callback'; | |
| export default async function handler(req: NextApiRequest, res: NextApiResponse) { | |
| const { code, state } = req.query; | |
| if (req.method === 'GET') { | |
| try { | |
| let cookie = req.headers.cookie; |
| package main | |
| import ( | |
| "html/template" | |
| "io" | |
| "log" | |
| "net/http" | |
| "github.com/labstack/echo/v4" | |
| ) |