Skip to content

Instantly share code, notes, and snippets.

version: '2'
services:
apache:
image: php:7.1.3-apache
ports:
- "80:80"
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName html.com
ServerAlias www.html.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# docker-compose.yml
version: '2'
services:
apache:
image: php:7.1.3-apache
volumes:
- content:/var/www/html/
apache-lb:
image: rancher/lb-service-haproxy:v0.6.4
<?php
echo "Hello, world!";
#rancher-compose.yml
version: '2'
services:
apache:
scale: 1
apache-lb:
scale: 1
lb_config:
# docker-compose.yml
version: '2'
services:
apache:
image: php:7.1.3-apache
volumes:
- content:/var/www/html/
apache-lb:
image: rancher/lb-service-haproxy:v0.6.4
ports:
version: '2'
services:
php:
image: php:7.1.3
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
@amy
amy / test.swift
Last active November 15, 2016 06:00
// creates a New Session
// returns Session ID
func createNewSession() ->String {
let urlString = "http://" + self.host + ":" + self.port + "/session"
guard let url = URL(string: urlString) else {
print("Error: cannot create URL")
return ""
}
var request = URLRequest(url: url)
@amy
amy / goQuestions.go
Last active September 25, 2016 16:57
/* 1 */
So I'm reading the documentation for database/sql for rows.Close():
"Close closes the Rows, preventing further enumeration. If Next returns false, the Rows are closed automatically
and it will suffice to check the result of Err. Close is idempotent and does not affect the result of Err.""
I still don't get what closing a row does. I get closing in the context of closing for like DB.close() since its a DB
connection. But what does closing a row mean. "Close closes the Rows". Its using the same word to describe itself.
Answer: DB Connection Pooling
Open is essentially only there to store credentials & never makes a connection.
Queries / Insert / etc. each create separate connections in the DB Connection Pool as they are independent of
// project/app/Application.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Application extends Model
{