Skip to content

Instantly share code, notes, and snippets.

Christoph, René Pardon renepardon

Block or report user

Report or block renepardon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@renepardon
renepardon / docker-compose.yml
Created Dec 20, 2018
Create CI/CD setup with Jenkins and worker nodes
View docker-compose.yml
version: '3.2'
services:
jenkins:
build: ./jenkins
container_name: jenkins
ports:
- "50000:50000"
expose:
- 8080
restart: always
View AuthenticatesUsers.php
<?php
protected function attemptLogin(Request $request)
{
$guards = array_keys(config('auth.guards'));
$attempts = [];
foreach ($guards as $guard) {
$guardInstance = Auth::guard($guard);
@renepardon
renepardon / php-implicit-type-cast.php
Created Nov 21, 2018
Annoying bool to string cast
View php-implicit-type-cast.php
function foo(?string $val)
{
echo (string) $val;
}
foo('test')
foo(true)
foo(false)
foo(null)
@renepardon
renepardon / in_array.php
Created Nov 21, 2018
PHP in_array() strange results for different types
View in_array.php
<?php
// PHP 7.2.10
$value = "test";
var_dump(
$value,
in_array($value, [1]),
in_array($value, [true]),
in_array($value, ['true']),
@renepardon
renepardon / docker-compose.yml
Last active Oct 25, 2018
404 of /js/app.js when running behind traefik proxy within docker-compose
View docker-compose.yml
auth:
build:
context: ./docker/auth
dockerfile: Dockerfile${DOCKERFILE_POSTFIX}
expose:
- 9000
environment:
- SERVICE_NAME=auth
labels:
- "traefik.enable=true"
View install_ffmpeg_ubuntu.sh
#!/bin/bash
# Usage example:
# /usr/local/bin/ffmpeg -i test.mp4 -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -preset slow -f mp4 -s 640x480 test-out.mp4
mkdir -p ~/ffmpeg_sources ~/bin
rm -rf ~/ffmpeg_build ~/bin/{ffmpeg,ffprobe,ffplay,ffserver,x264,x265
apt-get update -qq && apt-get -y install \
autoconf \
@renepardon
renepardon / playbook.yml
Created Dec 18, 2017
this is a local test with vars_prompt
View playbook.yml
---
- name: this is a local test with vars_prompt
hosts: 127.0.0.1
connection: local
pre_tasks:
- import_tasks: tasks/pre/load-vars.yml
vars_prompt:
- name: "company"
prompt: "Company of the project (lowercase)"
default: "mycompany"
View I18nTrait.php
<?php
namespace App;
use Carbon\Carbon;
use Illuminate\Support\Facades\Session as SessionFacade;
/**
* Trait I18nTrait
*
View Welcome.php
<?php
namespace App\Mail\Trainer;
use App\I18nTrait;
use App\Model\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
View SendWelcomeMail.php
<?php
namespace App\Listeners\Trainer;
use App\Event\UserRegistered;
use App\I18nTrait;
use App\Mail\Trainer\Welcome;
use Illuminate\Config\Repository as Config;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailer;
You can’t perform that action at this time.