Skip to content

Instantly share code, notes, and snippets.

View wallacemaxters's full-sized avatar

Wallace Maxters wallacemaxters

View GitHub Profile
@wallacemaxters
wallacemaxters / basic.blade.php
Created September 28, 2023 14:46
Templates prédefinidos para utilizar em um novo projeto Laravel
@props([
'bodyClass' => null,
'htmlClass' => '2xl:text-base lg:text-sm text-sm leading-normal',
'head' => null,
'title' => null,
'canonical' => url()->current(),
'description' => null,
'image' => null,
])
<!DOCTYPE html>
@wallacemaxters
wallacemaxters / atropos.blade.php
Last active August 1, 2023 20:10
Reusable component to easy use atropos in laravel
<!-- main Atropos container (required), add your custom class here -->
<div {{ $attributes->class('atropos') }}>
<!-- scale container (required) -->
<div class="atropos-scale">
<!-- rotate container (required) -->
<div class="atropos-rotate">
<!-- inner container (required) -->
<div class="atropos-inner">
{{ $slot }}
</div>
@wallacemaxters
wallacemaxters / speed_up_video.sh
Last active October 14, 2022 18:51
Speed up videos with ffmpeg command line
ffmpeg -i $1 -map 0:v -c:v copy -bsf:v h264_mp4toannexb raw.h264
ffmpeg -fflags +genpts -r 45 -i raw.h264 -c:v copy $2
rm raw.h264
@wallacemaxters
wallacemaxters / make_user_artisan.php
Created March 17, 2021 12:43
Comando para criar o usuário interativamente através da linha de comando do artisan. Command to create user from php artisan interactively.
<?php
Artisan::command('make:user', function () {
$email = $this->ask('Digite um e-mail');
$name = $this->ask('Digite o nome');
$password = $this->secret('Digite a senha');
$user = App\User::firstOrNew(['email' => $email]);
$exists = $user->exists;
@wallacemaxters
wallacemaxters / lista_cargos.json
Last active June 18, 2024 17:45
Lista de profissões/cargos em JSON
[
"abastecedor de linha de produção",
"abastecedor de máquinas",
"acabador de embalagens",
"acrilista",
"acupunturista",
"aderecista",
"adesivador",
"adestrador",
"administrador de contratos",
@wallacemaxters
wallacemaxters / json_encode_callback.php
Created August 9, 2018 20:39
json_encode implementation with callback, like JSON.stringify of the Javascript
<?php
/**
* @author Wallace Maxters <[email protected]>
* Encodes json after apply callback in data passed
*
* @param mixed $data
* @param callable $callback
* @param int $options
* @return string
@wallacemaxters
wallacemaxters / jotEvent.js
Last active May 9, 2018 16:59
Sugestão de manipulação de events para a biblioteca https://github.com/brcontainer/jot.js
(function (window) {
"use strict";
var forEach = Array.prototype.forEach;
var Event = function (nodeList) {
this.nodeList = nodeList;
};
var proto = Event.prototype;
@wallacemaxters
wallacemaxters / loading.svg
Last active November 18, 2024 22:48
Loading SVG + CSS with Spin
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wallacemaxters
wallacemaxters / routes.php
Created September 30, 2017 17:30
Execute function in Laravel after response sent to client
<?php
Route::get('/', function () {
$response = Response::json([
'process' => true
]);
return Response::withShutdownTask($response, function () {