Skip to content

Instantly share code, notes, and snippets.

View petrovi4ev's full-sized avatar
🎯
Focusing

Petrovichev Sergey petrovi4ev

🎯
Focusing
  • BitMedia-IO Crypto Ad Marketplace
  • Ukraine
View GitHub Profile
@petrovi4ev
petrovi4ev / middleware.go
Created July 16, 2021 09:25
Golang middleware example
// example from https://gowebexamples.com/advanced-middleware
package main
import (
"fmt"
"log"
"net/http"
"time"
)

Problem:

W: Не удалось получить https://mega.nz/linux/MEGAsync/xUbuntu_18.04/./InRelease  Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY 03C3AD3A7F068E5D

Solving:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 03C3AD3A7F068E5D
$answer = json_decode(file_get_contents('php://input'), true);
if (!empty($answer)) {
}

Fix problem: "PHP Warning: PHP Startup: Unable to load dynamic library 'tideways.so'"

Full description here: laradock/laradock#2169

Link to comment: laradock/laradock#2169 (comment)

cd laradock
docker-compose exec php-fpm sed -i "s/extension=tideways.so/;extension=tideways.so/" /usr/local/etc/php/conf.d/xhprof.ini
@petrovi4ev
petrovi4ev / API.md
Created February 28, 2019 09:41 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track