Skip to content

Instantly share code, notes, and snippets.

🌌
Wake up!

Lucas Pires flyingluscas

🌌
Wake up!
Block or report user

Report or block flyingluscas

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
@flyingluscas
flyingluscas / AttackOnTitanEpisodes.md
Last active Aug 15, 2018
Attack On Titan Episodes
View AttackOnTitanEpisodes.md

Shingeki no Kyojin - Episódio 20
HD
MQ

Shingeki no Kyojin - Episódio 22
HD
MQ

Shingeki no Kyojin - Episódio 25
HD

@flyingluscas
flyingluscas / Handler.php
Created Mar 19, 2017
Handling exceptions with JSON responses.
View Handler.php
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
View PHPUnitMockAbstractClass.md
use PHPUnit\Framework\TestCase;

abstract class Greeting
{
    public function hello($name)
    {
        return 'Hello '.$name;
    }
}
@flyingluscas
flyingluscas / PHPUnitMockInterface.md
Created Mar 14, 2017
PHPUnit: Mocking Interface
View PHPUnitMockInterface.md
use PHPUnit\Framework\TestCase;

interface Greeting
{
    public function hello($name);
}

class GreetingTest extends TestCase
{
@flyingluscas
flyingluscas / PHPUnitMockTrait.md
Last active Mar 14, 2017
PHPUnit: Mocking Trait
View PHPUnitMockTrait.md
use PHPUnit\Framework\TestCase;

trait Greeting
{
    public function hello($name)
    {
        return 'Hello '.$name;
    }
}
View SimpleLaravelAuthExample.md
public function login(Request $request)
{
    $email = $request->email;
    $password = $request->password;

    $user = User::where('email', $email)->first();

    if (! $user || ! Hash::check($password, $user->password)) {
        return 'You shall not pass!';
@flyingluscas
flyingluscas / FFMPEGMergAudioVideo.md
Last active Feb 11, 2017
FFMPEG Merge audio and video
View FFMPEGMergAudioVideo.md
ffmpeg -i video.mkv -i audio.wav -c:v copy -c:a aac -strict experimental output.mkv
@flyingluscas
flyingluscas / InstallPopcornTime.md
Last active Jul 25, 2019
Installing Popcorn Time on Ubuntu 16.x
View InstallPopcornTime.md

1. Downloading

32 bits version

$ wget https://get.popcorntime.sh/build/Popcorn-Time-0.3.10-Linux-32.tar.xz -O popcorntime.tar.xz

64 bits version

@flyingluscas
flyingluscas / FFMPEGYouTube.md
Last active Aug 15, 2018
FFMPEG Optimize videos for YouTube
View FFMPEGYouTube.md

Command

$ ffmpeg -i <input file> -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart <output_name>.mp4

Function

function youtube () {
@flyingluscas
flyingluscas / PHPArraySortExample.md
Last active Dec 20, 2016
PHP Array Sort Example
View PHPArraySortExample.md
$subject = [
  ['someValue' => 1],
  ['someValue' => 2],
  ['someValue' => 3],
];

usort($subject, 'desc');

// Ordenação crescente
You can’t perform that action at this time.