Skip to content

Instantly share code, notes, and snippets.

View ribafs's full-sized avatar
❤️
Estudando e Trabalhando

Ribamar FS ribafs

❤️
Estudando e Trabalhando
View GitHub Profile
version: '3'
services:
database:
image: postgres
healthcheck:
test:
[
"CMD",
"pg_isready",
"-q",
1) Se tiver o Docker instalado, remova!
2) Habilite o WSL no Windows 10
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
3) Habilitar o WSL para a versão 2
wsl --set-default-version 2
4) Instalar o Ubuntu na Microsoft Store
@mevdschee
mevdschee / ErrorReporting.php
Last active September 26, 2022 11:33
PHP error reporting class
<?php
class ErrorReporting
{
public static $errorMessage = 'Oops! Something went wrong.';
private static $cwd;
private static $debug;
/**
@cp6
cp6 / pdo_mysql_backup.php
Last active May 31, 2024 12:41
PHP PDO MySQL backup script with compression
<?php
$backup_config = array(
'DB_HOST' => '127.0.0.1',////Database hostname
'DB_NAME' => 'test_db',//Database name to backup
'DB_USERNAME' => 'root',//Database account username
'DB_PASSWORD' => '',//Database account password
'INCLUDE_DROP_TABLE' => false,//Include DROP TABLE IF EXISTS
'SAVE_DIR' => '',//Folder to save file in
'SAVE_AS' => 'test_db-',//Prepend filename
'APPEND_DATE_FORMAT' => 'Y-m-d-H-i',//Append date to file name
@CViniciusSDias
CViniciusSDias / ler-emails.php
Last active February 23, 2024 18:33
Script para ler e-mails em voz alta usando PHP
<?php
use PhpImap\Mailbox;
require_once 'vendor/autoload.php';
$mailbox = new Mailbox(
'{imap.gmail.com:993/imap/ssl}INBOX',
'seu-email@gmail.com',
'sua senha aqui',
@prof3ssorSt3v3
prof3ssorSt3v3 / app.js
Created February 24, 2021 01:39
IndexedDB part 4 - add, put, and delete
import { uid } from './uid.js';
console.log(uid());
//nothing else to import because we are using the built in methods
//https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase
const IDB = (function init() {
let db = null;
let objectStore = null;
let DBOpenReq = indexedDB.open('WhiskeyDB', 6);
@bmaupin
bmaupin / free-database-hosting.md
Last active July 22, 2024 16:24
Free database hosting
@bernie-haxx
bernie-haxx / Deployment_to_heroku_laravel.md
Last active September 30, 2023 01:57
DEPLOYMENT TO HEROKU LARAVEL

How to Deploy laravel Applications on Heroku.

Heroku-Laravel

Introduction

Welcome to a series of Deploying a Laravel Application.

Laravel applications are deployed on many sites.

I will be taking you through on how to deploy a laravel application which has a database and to be specific, Postgresql Database.

@DaveRandom
DaveRandom / rant.md
Last active February 2, 2024 16:18
Why you should not use relative paths when working with files in PHP

TL;DR do what the last section tells you to do

What is the difference between a relative path and an absolute path?

An absolute path is one which includes all path components from the root of the file system. It starts with a leading / on unix-like operating systems, or a drive letter on Windows.

Unix: /full/path/to/file.php

Windows C:\full\path\to\file.php

Zip excluding specific directories

Exclude .git file and node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/\*

Exclude .git file and files in node_modules directory, but keep node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/**\*