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 | |
function my_prefix_wp_editor_set_quality( $quality, $mime_type ) { | |
if ( $mime_type === 'image/jpeg' ) { | |
$quality = 90; | |
} elseif ( $mime_type === 'image/png' ) { | |
$quality = 91; | |
} elseif ( $mime_type === 'image/gif' ) { | |
$quality = 92; | |
} else { |
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 | |
error_reporting( E_ALL ); | |
ini_set( 'display_errors', true ); | |
if ( !headers_sent() ) { | |
header( 'X-Accel-Buffering: no' ); | |
} | |
function is_apache2() { |
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
def get_socket_socks5(proxy_host, proxy_port, proxy_username, proxy_password, host, port): | |
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
sock.connect((proxy_host,proxy_port)) | |
fd = sock.makefile() | |
sock.send("\x05\x01\x02") | |
server_status = sock.recv(8192) | |
if server_status != "\x05\x02": | |
return False | |
sock.send(struct.pack('B', 0x01) + struct.pack('B', len(proxy_username)) + proxy_username + struct.pack('B', len(proxy_password)) + proxy_password) | |
server_buffer = sock.recv(8192) |
NewerOlder