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
@ribafs
ribafs / php-cli-colors.php
Created September 3, 2022 17:34 — forked from jveldboom/php-cli-colors.php
PHP CLI Colors - PHP Class Command Line Colors (bash)
<?php
// from http://www.if-not-true-then-false.com/2010/php-class-for-coloring-php-command-line-cli-scripts-output-php-output-colorizing-using-bash-shell-colors/
class Colors {
private $foreground_colors = array();
private $background_colors = array();
public function __construct() {
// Set up shell colors
$this->foreground_colors['black'] = '0;30';
$this->foreground_colors['dark_gray'] = '1;30';
@ribafs
ribafs / extra.js
Created August 24, 2022 11:04 — forked from memeplex/extra.js
Mkdocs bootswatch tweaks
// Hide sidebar with less than 2 entries.
var sidebar = $('.bs-sidebar')
var entries = sidebar.children().first()
if (entries.children().length <= 1)
sidebar.css('display', 'none')
else {
entries.children(':not(.main)').css('text-indent', '10px')
}
$('h1').css('font-weight', 'bold')
@ribafs
ribafs / html_tags_you_can_use_on_github.md
Created August 5, 2022 13:03 — forked from seanh/html_tags_you_can_use_on_github.md
HTML Tags You Can Use on GitHub

HTML Tags You Can Use on GitHub

Wherever HTML is rendered on GitHub (gists, README files in repos, comments on issues and pull requests, ...) you can use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

But GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM syntactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

<details> and <summary>

A `<detai

A partir da versão 7.4 podemos definir propriedades de classes com tipos o que é muito interessante e importante.
Fui fazer um pequeno teste e me veio uma dúvida:
<?php
declare(strict_types=1); // Esta linha resolve o problema e exige de fato que os tipos sejam respeitados
class User
{
public int $id;
public string $name;
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use File;
class MakeViewCommand extends Command
{
/**

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/**\*
<script>
// Recomenda-se atualmente usar somente o let, mesmo para variáveis locais. Veja estes dois pequenos exemplos
let minhaVar = 'global'
for(c=0;c<2;c++){
let minhaVar= 'local'// Criada localmente no for
alert(minhaVar)
}
alert('Glo: '+minhaVar)
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