Skip to content

Instantly share code, notes, and snippets.

View renepardon's full-sized avatar

Christoph, René Pardon renepardon

View GitHub Profile
#!/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 December 18, 2017 14:54
this is a local test with vars_prompt
---
- 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"
<?php
namespace App;
use Carbon\Carbon;
use Illuminate\Support\Facades\Session as SessionFacade;
/**
* Trait I18nTrait
*
<?php
namespace App\Mail\Trainer;
use App\I18nTrait;
use App\Model\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
<?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;
@renepardon
renepardon / convert-to-utf8.sql
Created September 22, 2017 12:14
Converting broken data to UTF8 with MySQL
UPDATE <table> SET <column> = CONVERT(BINARY CONVERT(<column> USING latin1) USING utf8);
---
# Some more definitions above...
-
type: ezselection
name: Abstract Position
identifier: abstract_position
required: true
default-value: left
field-settings:
isMultiple: true
<?php
class MyClass
{
public function export()
{
$exportable = $this->prepareData($tags);
// ...
$excel->sheet('Tags', function ($sheet) use ($exportable) {
$sheet->fromGenerator($exportable, null, 'A1', false);
for (i = 0; i < 10000; i++) {
$('#container').append(i + '<br />')
}
@renepardon
renepardon / gist:9a325e45da4aba639b10
Last active August 31, 2015 13:49
Scalar type hints in PHP 7 - check if all elements of $numbers are of type int
<?php
declare(strict_types=1);
class Test
{
public static function sum(int ... $numbers): int
{
return array_sum($numbers);
}
}