$ minikube version
minikube version: v1.7.1
require_once 'vendor/autoload.php'; | |
use Google\Spreadsheet\DefaultServiceRequest; | |
use Google\Spreadsheet\ServiceRequestFactory; | |
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . __DIR__ . '/my_secret.json'); | |
/* SEND TO GOOGLE SHEETS */ | |
$client = new Google_Client; | |
try{ | |
$client->useApplicationDefaultCredentials(); | |
$client->setApplicationName("Something to do with my representatives"); |
function calculate_age($birthday) { | |
$birthday_timestamp = strtotime($birthday); | |
$age = date('Y') - date('Y', $birthday_timestamp); | |
if (date('md', $birthday_timestamp) > date('md')) { | |
$age--; | |
} | |
return $age; | |
} | |
//вызов функции |
import socket | |
from BaseHTTPServer import HTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
class MyHandler(SimpleHTTPRequestHandler): | |
def do_GET(self): | |
if self.path == '/ip': | |
self.send_response(200) | |
self.send_header('Content-type', 'text/html') | |
self.end_headers() |