Skip to content

Instantly share code, notes, and snippets.

View Toflar's full-sized avatar

Yanick Witschi Toflar

View GitHub Profile
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ .Values.web.name }}-ingress
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: {{ .Values.web.host }}
http:
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.web.name }}
labels:
my-super-app: {{ .Values.web.name }}
spec:
ports:
- name: http
port: 80
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.web.name }}
labels:
my-super-app: {{ .Values.web.name }}
spec:
replicas: 1
selector:
matchLabels:
image: docker:stable
services:
- docker:dind
stages:
- build
- deploy
variables:
@Toflar
Toflar / ProfileAction.php
Last active October 26, 2018 15:14
Simple way to get my profile in ApiPlatform
<?php
namespace App\Action;
use App\Entity\User;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route;
class ProfileAction extends Controller
HTTP/1.1 201 Created
Location: /jobs/5241c3603853e648127910e71ea235b7
Content-Type: application/json; charset=UTF-8
{
"jobId": "5241c3603853e648127910e71ea235b7",
"status": "queued",
"retries": 0,
"worker": "worker-hostname",
"links": {
@Toflar
Toflar / request.txt
Created June 10, 2018 15:12
Medium - Composer Cloud
POST /jobs
Content-Type: application/json
Accept: application/json
{
"composerJson": {
"name": "...",
"version": "...",
"requires": {
@Toflar
Toflar / index.php.patch
Last active November 7, 2018 12:09
Symfony 4 index.php with env data for production
<?php
use App\Kernel;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\HttpFoundation\Request;
require __DIR__.'/../vendor/autoload.php';
// The check is to ensure we don't use .env in production
@Toflar
Toflar / gist:5d64cd4a10b0cefcec5e88a584e8dd6f
Created December 13, 2017 13:54
sf function for bash_profile
sf() {
if [ -f ./vendor/bin/contao-console ]; then
./vendor/bin/contao-console $@
return $?
fi;
if [ -f ./bin/console ]; then
./bin/console $@
return $?
fi;
if [ -f ./app/console ]; then