Skip to content

Instantly share code, notes, and snippets.

View LaisGalvao's full-sized avatar
🎯
Focusing

Laís Galvão LaisGalvao

🎯
Focusing
View GitHub Profile
#!/bin/bash
# Configurações iniciais
echo "Configurando ambiente Java..."
# Atualiza pacotes
sudo apt update && sudo apt upgrade -y
# Instala dependências básicas
sudo apt install -y curl unzip zip git
@LaisGalvao
LaisGalvao / setup_dev_env_ubuntu.sh
Created March 17, 2025 14:44
Setup dev env Ubuntu
#!/bin/bash
set -e
# Atualiza o sistema
echo "Atualizando o sistema..."
sudo apt update && sudo apt upgrade -y
# Instala dependências básicas

Docker Cheat Sheet

Comandos Básicos

  • Verificar Versão do Docker

    docker --version
  • Verificar Versão do Docker Compose


Docker Cheat Sheet

Comandos Básicos

  • Verificar Versão do Docker
    docker --version

Docker Cheat Sheet

Comandos Básicos

  • Verificar Versão do Docker
    docker --version
@LaisGalvao
LaisGalvao / nginx.conf
Created May 14, 2024 14:53 — forked from mreschke/nginx.conf
Nginx config for multiple laravel sites based on /api/v1 url paths
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2...
# This also works perfectly for all static file content in all projects
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config.
# Example:
# http://example.com - Main Laravel site as usual
# http://example.com/about - Main Laravel site about page as usual
# http://example.com/robots.txt - Main Laravel site static content as usual
# http://example.com/api/v1 - Lumen v1 api default / route
# http://example.com/api/v1/ - Lumen v1 api default / route
@LaisGalvao
LaisGalvao / .ts
Created February 27, 2024 11:53
FizzBuzz Typescript Sample
'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString: string = '';
let inputLines: string[] = [];
let currentLine: number = 0;
process.stdin.on('data', function(inputStdin: string): void {
@LaisGalvao
LaisGalvao / helpers.js
Last active February 16, 2024 21:27
Helpers para diversas situações - Vue.js / JS
// Função helper que faz adicionar query na url sem dar reload na página
addQueryParam (param) {
const currentQuery = { ...this.$route.query }
currentQuery.key = param
const newUrl = `${window.location.pathname}?${new URLSearchParams(currentQuery).toString()}`
// Use history.replaceState para alterar a URL sem recarregar o componente
window.history.replaceState({}, '', newUrl)
}
@LaisGalvao
LaisGalvao / reset.css
Created March 20, 2023 13:22 — forked from DavidWells/reset.css
CSS reset. Follow me on the twitters for more tips: https://twitter.com/davidwells
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
const puppeteer = require('puppeteer');
class Webpage {
static async generatePDF(url) {
const browser = await puppeteer.launch({ headless: true }); // Puppeteer can only generate pdf in headless mode.
const page = await browser.newPage();
await page.goto(url, { waitUntil: 'networkidle', networkIdleTimeout: 5000 }); // Adjust network idle as required.
const pdfConfig = {
path: 'url.pdf', // Saves pdf to disk.
format: 'A4',