This file contains 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
function multiRequest(array $requests = []): array | |
{ | |
$std_options = [ | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_FOLLOWLOCATION => true, | |
CURLOPT_MAXREDIRS => 5 | |
]; | |
$mh = curl_multi_init(); | |
$handlers = []; |
This file contains 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
package main | |
import "fmt" | |
func main() { | |
fmt.Println("Hello multi stage build") | |
} |
This file contains 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
package main | |
import ( | |
"database/sql" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
_ "github.com/go-sql-driver/mysql" | |
) |
This file contains 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
#!/usr/bin/env bash | |
readonly TOKEN=YOUR_APP_TOKEN | |
readonly DIR=/YOUR_DIR_PATH | |
FILE=$1 | |
BASENAME=$(basename $FILE) | |
if [ -f "$FILE" ]; then |
This file contains 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
FROM php:7.2-cli | |
RUN apt-get update && apt-get install -y libmemcached-dev zlib1g-dev \ | |
&& pecl install memcached-3.0.4 \ | |
&& docker-php-ext-enable memcached |
This file contains 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 | |
const KEY = 'foo'; | |
const VALUE = 'bar'; | |
$memcached = new Memcached(); | |
$memcached->setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_MODULA); | |
$memcached->addServers([ | |
['memcached1', 11211], | |
['memcached2', 11211] |
This file contains 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 | |
/** | |
* This is project's console commands configuration for Robo task runner. | |
* | |
* @see http://robo.li/ | |
*/ | |
class RoboFile extends \Robo\Tasks | |
{ | |
/** | |
* Shows how to start with robo. |
This file contains 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 | |
$list = [ | |
new DateTime('yesterday'), | |
new DateTime('today'), | |
new DateTime('1 week ago'), | |
]; | |
usort($list, function ($a, $b) { | |
return $a <=> $b; |
This file contains 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 | |
/** | |
* This is project's console commands configuration for Robo task runner. | |
* | |
* @see http://robo.li/ | |
*/ | |
class RoboFile extends \Robo\Tasks | |
{ | |
/** |
This file contains 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 | |
require_once './vendor/autoload.php'; | |
/** | |
* This is project's console commands configuration for Robo task runner. | |
* | |
* @see http://robo.li/ | |
*/ | |
class RoboFile extends \Robo\Tasks |
OlderNewer