Skip to content

Instantly share code, notes, and snippets.

Avatar
😆

Igor C. de Paula IgorDePaula

😆
View GitHub Profile
View collection.php
<?php
$items = [];
foreach ($products as $value) {
$items[] = [
'product_id' => $value->id,
'name' => $value->name,
];
}
return collect($items)->all();
View HospitalController.php
<?php
...
class HospitalCnotroller{
public function index(Request $request){
$hospitas = Hospital::all()->pluck('nome','id');
$dados = Servidor::where('hospital',$request->hospital)->paginate();
return view('servidores',['dados'=>$dados,'hospital'=>$hospital,'hospitais'=>$hospitais]);
}
}
View TypeValidator.js
export default (type) => ['success', 'info', 'danger', 'warning'].indexOf(type) > -1
@IgorDePaula
IgorDePaula / Checkbox.js
Created Sep 21, 2020
Checkbox com vue and tailwindcss
View Checkbox.js
const Checkbox = {
name: 'Checkbox',
template: '<div>' +
'<div class="input-text cursor-pointer flex h-10" @click="emit">' +
'<div class="h-4 w-4 rounded border-2 border-green-700 m-auto" :class="newClass">' +
'<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3 fill-current text-white" v-if="checked" viewBox="0 0 20 20"><path d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg>' +
'</div>' +
'<div class="self-center flex-1 px-1 pb-1" v-html="label"></div>' +
'</div>' +
'</div>',
@IgorDePaula
IgorDePaula / RadioButton.js
Last active Sep 18, 2020
Radio Button puro em vuejs e tailwindcss (classe input-text é um conjunto add com ```@apply``` do tailwindcss)
View RadioButton.js
const RadioButton = {
name: 'RadioButton',
template: '<div>' +
'<div class="input-text cursor-pointer flex h-10" @click="$emit(\'input\', valor)">' +
'<div class="h-4 w-4 rounded-full border-2 border-green-700 m-auto" :class="newClass">' +
'<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3 fill-current text-white" v-if="checked == valor" viewBox="0 0 20 20"><path d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg>' +
'</div>' +
'<div class="self-center flex-1 px-2 pb-1">{{label}}</div>' +
'</div>',
computed: {
@IgorDePaula
IgorDePaula / Dockerfile
Created Aug 20, 2020
docker and docker-compose laravel app
View Dockerfile
FROM composer:latest AS composer
FROM php:7.3-apache
RUN apt-get update && apt-get install -y \
unzip \
git \
zip \
nano \
curl \
zlib1g-dev \
View main.go
package main
import (
"errors"
"flag"
"fmt"
"os"
)
func NewGreetCommand() *GreetCommand {
@IgorDePaula
IgorDePaula / main.go
Created Jul 31, 2020
go parse execution flags
View main.go
package main
import (
"flag"
"fmt"
"os"
)
type Car struct {
Model []string
@IgorDePaula
IgorDePaula / deploy.yml
Created Jul 27, 2020
github action deploy
View deploy.yml
name: Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
View go-workflow.yml
name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
You can’t perform that action at this time.