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

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/**\*
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
@ribafs
ribafs / Dockerfile
Created April 16, 2022 11:46
Simple PHP7.4, sqlite3, nodejs npm, for Alpine container Docker
FROM alpine
RUN apk add --no-cache curl sqlite gd openssl nodejs npm php7-intl php7-openssl php7-sqlite3 php7-tokenizer php7-common php7 php7-snmp php7-doc php7-fileinfo php7-mbstring php7-dev php7-xmlreader php7-pdo_sqlite php7-opcache php7-ldap php7-posix php7-session php7-gd php7-json php7-xml php7-iconv php7-curl php7-phar php7-imap php7-zip php7-ctype php7-bcmath php7-calendar php7-dom php7-sockets php7-dbg php7-ffi php7-ftp php7-sysvsem php7-pdo php7-bz2 php7-simplexml php7-xmlwriter
#install Composer
#check last composer intaller instructions
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
RUN php composer-setup.php
RUN php -r "unlink('composer-setup.php');"
RUN mv composer.phar /usr/local/bin/composer
@ribafs
ribafs / free-database-hosting.md
Created April 6, 2022 21:37 — forked from bmaupin/free-database-hosting.md
Free database hosting

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.

@ribafs
ribafs / DatabaseUtils.php
Created February 14, 2022 14:45 — forked from bencentra/DatabaseUtils.php
Revised version of db_utils.php, refactored as a PHP class.
<?php
/*
* DatabaseUtils.php - A class of simple database utilities.
*
* Performs CRUD operations using PDO (MySQL) prepared statements.
*
* Author: bencentra (https://gist.github.com/bencentra/92228e1f4139436c4153)
*/
@ribafs
ribafs / database.class.php
Created February 11, 2022 19:58 — forked from ftonato/database.class.php
PDO Connection Class using Singleton
<?php
/**
* PDO Singleton Class v.1.0
*
* @author Ademílson F. Tonato
* @link https://twitter.com/ftonato
*
*/
class DB {
@ribafs
ribafs / List.md
Created December 20, 2021 22:00 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@ribafs
ribafs / FixtureTestCase.php
Created December 19, 2021 19:04 — forked from jeremyharris/FixtureTestCase.php
Full code for: http://someguyjeremy.com/blog/database-testing-with-phpunit Place fixtures in a `fixture` folder.
<?php
// we're loading the Database TestCase here
require 'PHPUnit' . DIRECTORY_SEPARATOR . 'Extensions' .
DIRECTORY_SEPARATOR . 'Database' . DIRECTORY_SEPARATOR .
'TestCase.php';
class FixtureTestCase extends PHPUnit_Extensions_Database_TestCase {
public $fixtures = array(
'posts',
@ribafs
ribafs / pdo_db.php
Created December 15, 2021 15:00 — forked from bradtraversy/pdo_db.php
PDO Class
<?php
/*
* PDO DATABASE CLASS
* Connects Database Using PDO
* Creates Prepeared Statements
* Binds params to values
* Returns rows and results
*/
class Database {
private $host = DB_HOST;