Skip to content

Instantly share code, notes, and snippets.

View flyingluscas's full-sized avatar
🏠
Working from home

fly flyingluscas

🏠
Working from home
View GitHub Profile
@flyingluscas
flyingluscas / sweetalert.js
Created October 15, 2017 19:10
Sweetalert Example
swal({
title: 'Bom trabalho!',
text: 'O seu pedido foi cadastrado com sucesso!',
icon: 'success',
button: 'Imprimir',
})
.then(function () {
window.location.href = '/cadastro/servico'
})
public function testPartialJsonResponse()
{
    $response = $this->json('GET', '/api/users/1');

    $response
        ->assertStatus(200)
        ->assertJsonFragment([
            'name' => 'Anakin Skywalker',
 ]);
{
    "id": 1,
    "name": "Anakin Skywalker",
    "email": "anakin@death.star",
    "created_at": "2017-02-14 01:53:04",
    "updated_at": "2017-02-14 01:53:04"
}
Route::get('/api/users/{id}', function ($id) {
    return App\User::find($id);
});
@flyingluscas
flyingluscas / ShellFunctions.md
Last active November 20, 2019 21:25
Shell functions to run things like NPM, Composer and PHP using Docker.

Shell functions to run things using Docker.

Versions

Control the versions using environment variables, put this in your .bashrc or .zshrc.

PHP_VERSION=7.1
NODE_VERSION=8.0
@flyingluscas
flyingluscas / PiadaBoa.md
Created June 4, 2017 02:31
Piada do jQuery

YOU MIGHT NOT NEED JQUERY PLUGINS

YOU MIGHT NOT NEED JQUERY

YOU MIGHT NOT NEED

YOU MIGHT NOT

YOU MIGHT

@flyingluscas
flyingluscas / docker-compose.yml
Created May 14, 2017 08:33
CS 1.6 Server with Docker
version: '2'
services:
cstrike:
image: jarlefosen/cs16
container_name: cs16_server
ports:
- 26900:26900/udp
- 27020:27020/udp
- 27015:27015/udp
@flyingluscas
flyingluscas / .zshrc
Last active August 15, 2018 13:15
My Terminal Settings
ZSH_THEME="spaceship"
plugins=(git zsh-autosuggestions)
function artisan {
( php artisan $* )
}
function phpunit {
( vendor/bin/phpunit $* )
@flyingluscas
flyingluscas / ReturnReplacementForElse.md
Last active April 17, 2017 17:38
Return Replacement for else

Case One

Wrong

$name = 'Lucas';
$greeting = null;

if (is_null($name)) {
    $greeting = 'No name was provided';
} else {
@flyingluscas
flyingluscas / ArrayReplacementForSwitch.md
Last active April 17, 2017 17:31
Array Replacement for Switch
$subject = 'flying';

switch ($subject) {
    case 'flying':
        $result = 'potato';
        break;

    case 'bacon':
 $result = 'is life';