Skip to content

Instantly share code, notes, and snippets.

View IgorDePaula's full-sized avatar
😆

Igor C. de Paula IgorDePaula

😆
View GitHub Profile
<?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]);
}
}
export default (type) => ['success', 'info', 'danger', 'warning'].indexOf(type) > -1
@IgorDePaula
IgorDePaula / Checkbox.js
Created September 21, 2020 18:05
Checkbox com vue and tailwindcss
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 September 18, 2020 19:42
Radio Button puro em vuejs e tailwindcss (classe input-text é um conjunto add com ```@apply``` do tailwindcss)
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 August 20, 2020 23:37
docker and docker-compose laravel app
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 \
@IgorDePaula
IgorDePaula / main.go
Created August 1, 2020 23:44
flag subcommand
package main
import (
"errors"
"flag"
"fmt"
"os"
)
func NewGreetCommand() *GreetCommand {
@IgorDePaula
IgorDePaula / main.go
Created July 31, 2020 21:50
go parse execution flags
package main
import (
"flag"
"fmt"
"os"
)
type Car struct {
Model []string
@IgorDePaula
IgorDePaula / deploy.yml
Created July 27, 2020 16:54
github action deploy
name: Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)