Skip to content

Instantly share code, notes, and snippets.

@Padilo300
Padilo300 / google sheets php гугл таблицы php
Created October 4, 2019 18:36
google sheets php гугл таблицы php
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");
@kfcobrien
kfcobrien / .BASH-PROMPT.png
Last active September 4, 2023 14:55
Clean informative bash prompt with git info
.BASH-PROMPT.png
@Padilo300
Padilo300 / PHP вычислить возраст по дате рождения.
Created January 29, 2018 14:14
PHP вычислить возраст по дате рождения.
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;
}
//вызов функции
@subfuzion
subfuzion / curl.md
Last active May 9, 2024 18:17
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 12, 2024 01:58
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@akorobov
akorobov / ipv6-httpd.py
Created December 11, 2013 00:58
quick ipv6 http server using python's SimpleHttpServer
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()