A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer
- Composer Related
- Frameworks
- Micro Frameworks
#!/bin/sh -eu | |
# A script to mirror a website using wget | |
usage() { | |
cat << EOF | |
Usage: $(basename "$0") [-w website] [-u user_agent] [-b] | |
Where: | |
-w The website to mirror. The website will be like "https://example.com/" | |
-u The User agent to use. If no User agent is specified, | |
a Firefox default one is used. |
В Nvim существует несколько плагинов, которые могут помочь вам форматировать код PHP. Вот некоторые из них:
php-cs-fixer
: Этот плагин был описан в предыдущем ответе и позволяет автоматически форматировать код согласно стандартам PHP.
Для настройки php-cs-fixer
в nvim, добавьте следующую строку в файл конфигурации:
lua
require('php-cs-fixer').setup()
The goal is to implement a proxy server for HTTP and HTTPS. Handling of HTTP is a matter of parsing request, passing such request to destination server, reading response and passing it back to the client. All we need for that is built-in HTTP server and client (net/http). HTTPS is different as it’ll use technique called HTTP CONNECT tunneling. First client sends request using HTTP CONNECT method to set up the tunnel between the client and destination server. When such tunnel consisting of two TCP connections is ready, client starts regular TLS handshake with destination server to establish secure connection and later send requests and receive responses. Certificates
Our proxy will be an HTTPS server (when —-proto https will be used) so we need certificate and private key. For the purpose of this post let’s use self-signed certificate. To generate one use such script:
#!/usr/bin/env bashcase `uname -s` in
package main | |
import ( | |
"context" | |
"fmt" | |
"os" | |
"os/signal" | |
"path" | |
"sync" | |
"syscall" |
package main | |
import ( | |
"flag" | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"strings" | |
) |
# IE is still braindead so still use favicon.ico | |
convert -resize x16 -gravity center -crop 16x16+0+0 -flatten -colors 256 input.png output-16x16.ico | |
convert -resize x32 -gravity center -crop 32x32+0+0 -flatten -colors 256 input.png output-32x32.ico | |
convert output-16x16.ico output-32x32.ico favicon.ico | |
# Then, HTML needs to specify size="XxY" as largest size due to browser bugs | |
<link rel="shortcut icon" href="/favicon.ico" sizes="32x32"> |
import gym | |
from gym.envs.registration import register | |
from gym import error, spaces, utils | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import pandas_datareader.data as web | |
import arrow | |
import random | |
import sys |
# Import the Github Repository Reader class | |
import os | |
from tokens import githubToken, apikey | |
import openai | |
from llama_index.readers import GithubRepositoryReader | |
from llama_index import VectorStoreIndex | |
from llama_index import StorageContext, load_index_from_storage | |
openai.api_key = apikey |