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 ( | |
"flag" | |
"log" | |
"os" | |
"os/exec" | |
) | |
func main() { |
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 ( | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"time" | |
) |
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 | |
try { | |
(new PDO( | |
'mysql:host=' . getenv('DB_SERVER'), | |
getenv('DB_USER'), | |
getenv('DB_PASSWORD') | |
))->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
echo 'success'; |
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
func run(r command.Runner, p command.Preparer) error { | |
args, err := p.Prepare() | |
if err != nil { | |
return err | |
} | |
if p.HasInput() { | |
if err := r.SetInput(p.GetInput()); err != nil { | |
return err | |
} |
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
var candies = []; | |
var boxes = []; | |
// var boxes = [{"number": 1, "count": 12, "weight": 8.093},{"number": 2, "count": 16, "weight": 9.3}]; | |
function makeCandies(num) { | |
var i = 0; | |
for (i = 0; i < num; i++) { | |
candies.push({ | |
name: "candy", |
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
// left out for brevity | |
serverMiddleware: [ | |
{ | |
path: 'api/v1', | |
handler: '~/api/v1/index.js' | |
} | |
], |
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
const httpProxy = require('http-proxy') | |
const proxy = httpProxy.createProxyServer() | |
const API_URL = process.env.API_URL || 'https://api.mydomain.com' | |
export default function(req, res, next) { | |
proxy.web(req, res, { | |
target: API_URL | |
}) | |
} |
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
// lives at /api/index.js | |
const httpProxy = require('http-proxy') | |
const proxy = httpProxy.createProxyServer() | |
const API = process.env.API_URL || 'http://localhost:8080/v1alpha1/graphql' | |
export default function(req, res, next) { | |
proxy.web(req, res, { | |
target: API | |
}) | |
} |
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
.DEFAULT: local | |
IMAGE ?= your-docker-image | |
TAG ?= staging | |
REGISTRY ?= your-registry-info | |
build: | |
docker build . -t $(IMAGE):$(TAG) | |
down: |
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
<VirtualHost *:80> | |
<IfModule mod_setenvif.c> | |
SetEnvIf X-Forwarded-Proto "^https$" HTTPS | |
</IfModule> | |
ServerAdmin [email protected] | |
DocumentRoot /var/www/html/web | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined |
NewerOlder