Twelve Go Best Practices
Francesc Campoy Flores Gopher at Google @francesc http://campoy.cat/+
- Best practices
#!/usr/bin/env php | |
<?php | |
declare(strict_types=1); | |
namespace CodeReviewsIo\Worker; | |
use CodeReviewsIo\Domain\Command\TickTime; | |
use Prooph\ServiceBus\CommandBus; | |
use React\EventLoop\Factory; |
<?php declare(strict_types=1); | |
require_once "✨.🐘"; | |
✨($_)->strlen("foo")->var_dump($_); |
Twelve Go Best Practices
Francesc Campoy Flores Gopher at Google @francesc http://campoy.cat/+
fff.red { | |
header / { | |
Strict-Transport-Security "max-age=31536000; includeSubDomains" | |
Content-Security-Policy "default-src https:*" | |
Public-Key-Pins "pin-sha256=\"ckOIjdimiwD3mfMmkmCh7uiJCBtXvoqoBoKKB1K5UIM=\"; pin-sha256=\"QiTyymM4e635OgWkx9d7nq5xvEuqmgV7HiDjIIGyymo=\"; max-age=2592000" | |
X-Frame-Options SAMEORIGIN | |
X-XSS-Protection "1; mode=block" | |
X-Content-Type-Options nosniff | |
} | |
} |
A running example of the code from:
Small refactorings made to original code:
package main | |
import ( | |
"net/http" | |
) | |
func redirect(w http.ResponseWriter, req *http.Request) { | |
http.Redirect(w, req, | |
"https://" + req.Host + req.URL.String(), | |
http.StatusMovedPermanently) | |
} |
Adyen Test Card Numbers | |
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform. | |
For all cards use the following expiration and CVV2/CVC2/or CID for Amex. | |
For all cards: | |
Expiration Dates CVV2 / CVC3 CID (American Express) | |
06/2016 OR 08/2018 737 7373 |
<?php | |
$options = getopt("f:o:"); | |
if (! isset($options['f'])) { | |
echo "Files have to be specified with -f\n"; | |
exit(1); | |
} | |
if (! isset($options['o'])) { | |
echo "Output has to be specified with -o\n"; | |
exit(1); | |
} |
FROM ubuntu:16.04 | |
RUN PACKAGES="\ | |
php-cli \ | |
php-mysql \ | |
php-intl \ | |
php-xml \ | |
php-curl \ | |
php-dom \ | |
" && \ |