Skip to content

Instantly share code, notes, and snippets.

View maikyguanaes's full-sized avatar
🕉️
I may be slow to respond.

Maiky Guanaes maikyguanaes

🕉️
I may be slow to respond.
View GitHub Profile
@code-boxx
code-boxx / 0-PHP-EXCEL-ADD.MD
Created October 18, 2023 09:47
PHP Add Rows To Excel File

PHP ADD NEW ROWS TO EXCEL FILE

https://code-boxx.com/php-add-rows-excel/

NOTES

  1. GIST does not allow Excel files. Convert x-dummy.csv to x-dummy.xlsx on your own, or use your own dummy Excel file.
  2. Install Composer - https://getcomposer.org/
  3. Install PHPSpreadsheet.
    • Open the terminal.
    • Navigate to your project folder - cd MY/PROJECT/FOLDER
  • Run composer require phpoffice/phpspreadsheet
@marciojg
marciojg / Guia rápido de instalação do WSL2 + Docker.md
Last active September 6, 2024 19:56 — forked from argentinaluiz/Guia rápido de instalação do WSL2 + Docker.md
Startup DEV WINDOWS/LINUX - Guia rápido de instalação do WSL2 + Docker

Startup DEV WINDOWS/LINUX - Guia rápido de instalação do WSL2 + Docker

INSTRUCÃO OFICIAL: https://docs.microsoft.com/pt-br/windows/wsl/install-win10

Em 2016, a Microsoft anunciou a possibilidade de rodar o Linux dentro do Windows 10 como um subsistema e o nome a isto foi dado de WSL ou Windows Subsystem for Linux.

O acesso ao sistema de arquivos no Windows 10 pelo Linux era simples e rápido, porém não tinhamos uma execução completa do kernel do Linux e outros artefatos nativos e isto impossibilitava a execução de várias tarefas no Linux, uma delas é o Docker.

Em 2019, a Microsoft anunciou o WSL2, com uma dinâmica aprimorada em relação a 1ª versão:

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 17, 2024 04:56 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@ka-seo
ka-seo / Custom Browsers Color.html
Created September 24, 2016 21:39
Set color toolbar in mobile browsers
<!-- Insert in head -->
<!-- Custom Browsers Color Start -->
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#000">
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#000">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#000">
<!-- Custom Browsers Color End -->
@davidalves1
davidalves1 / formatar_cnpj_cpf.md
Last active October 22, 2024 14:21
Função para formatar CNPJ e CPF, disponível em PHP e JS

PHP

function formatCnpjCpf($value)
{
  $CPF_LENGTH = 11;
  $cnpj_cpf = preg_replace("/\D/", '', $value);
  
  if (strlen($cnpj_cpf) === $CPF_LENGTH) {
    return preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
  } 
@dscamahorn
dscamahorn / meta-tags-favicon.html
Last active October 2, 2017 02:29
Favicon, touch/web clip, tile and pin configuration. Includes Chrome for Android address bar background color (theme-color).
<!--Favicon-->
<link rel="shortcut icon" type="image/ico" href="favicon.ico" />
<!--Tile-->
<meta name="application-name" content="System Name"/>
<meta name="msapplication-TileColor" content="#000"/>
<meta name="msapplication-square70x70logo" content="tile-tiny.png"/>
<meta name="msapplication-square150x150logo" content="tile-square.png"/>
<meta name="msapplication-wide310x150logo" content="tile-wide.png"/>
<meta name="msapplication-square310x310logo" content="tile-large.png"/>
<!--Pin-->
@HeroicEric
HeroicEric / rspec_helper_example.md
Created April 2, 2014 14:41
An example of how to create a RSpec test helper

RSpec Helper Example

Here's an example of a rspec test helper that will let you sign in as a given user.

Create spec/support/helpers/authentication.rb with the following:

module Helpers
  module Authentication
    def sign_in_as(user)