Skip to content

Instantly share code, notes, and snippets.

@prabhu
prabhu / bitbucket-reusable-pipelines.yml
Created July 26, 2020 13:56
Reusable Bitbucket pipelines configuration with YAML anchors
definitions:
steps:
- step: &build
name: Build microservices jar
script:
- mvn package
artifacts:
- target/**
- step: &build-react
name: Build React app
@freekmurze
freekmurze / Envoy.blade.php
Created March 23, 2017 13:50
Multi server zero downtime Envoy script
@setup
require __DIR__.'/vendor/autoload.php';
(new \Dotenv\Dotenv(__DIR__, '.env'))->load();
$appName = "my-app.com";
$repository = "spatie/{$appName}";
$baseDir = "/home/forge/{$appName}";
$releasesDir = "{$baseDir}/releases";
$currentDir = "{$baseDir}/current";
$newReleaseName = date('Ymd-His');
@freekmurze
freekmurze / validate.md
Last active February 15, 2018 17:29
A handy validate function for Laravel 5
/**
 * Validate some data.
 *
 * @param string|array $fields
 * @param string|array $rules
 * @return bool
 */
function validate($fields, $rules)
{