This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.minimap.maxColumn": 40 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"html/template" | |
"io" | |
"log" | |
"net/http" | |
"github.com/labstack/echo/v4" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
type BadWord struct { | |
Word string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Database | |
{ | |
private static $pgInstance = null; | |
private \PDO $pdo; | |
public function __construct($host, $port, $dbname, $user, $password) | |
{ | |
$dsn = sprintf("pgsql:host=%s;port=%d;dbname=%s", $host, $port, $dbname); | |
try { | |
$this->pdo = new \PDO($dsn, $user, $password); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
//make a program standby | |
times := make(chan time.Time) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pull the image | |
docker pull typesense/typesense:0.26.0.rc25 | |
#run you image as containe | |
#- make sure you are in Documents directory | |
cd Documents | |
makdir typesense-data |
NewerOlder