function cpfMask(cleanValue) {
return cleanValue.replace(/^(\d{3})(\d{3})(\d{3})(\d{2}).*/, '$1.$2.$3-$4');
}
function cnpjMask(cleanValue) {
return cleanValue.replace(/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2}).*/, '$1.$2.$3/$4-$5');
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install RBenv in /opt/ for all users | |
echo '# == Rbenv ==' > /etc/profile.d/rbenv.sh | |
echo 'export RBENV_ROOT=/opt/rbenv' >> /etc/profile.d/rbenv.sh | |
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh | |
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh | |
chmod +x /etc/profile.d/rbenv.sh | |
source /etc/profile.d/rbenv.sh | |
curl https://raw.githubusercontent.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.map = null; | |
$scope.$on('mapInitialized', function(event, map) { | |
$scope.map = map; | |
}); | |
$scope.$on('cfpLoadingBar:completed', function () { | |
$timeout(function() { | |
google.maps.event.trigger($scope.map,'resize') | |
}, 1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl - Raw upload | |
curl -X PUT -T image.png https://example.com/upload | |
# curl - Content-Type: multipart/form-data | |
curl -F name=logo -F [email protected] https://example.org/upload | |
# curl - POST presigned URL (S3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROM ruby:2.2.3 | |
RUN apt-get update -qq && apt-get install -y build-essential | |
RUN apt-get install -y libpq-dev | |
RUN apt-get install -y ghostscript | |
RUN mkdir /app | |
WORKDIR /app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
set rtp+=~/.vim/bundle/Vundle.vim " set the runtime path to include Vundle | |
call vundle#begin() " and initialize | |
" Keep Plugin commands between vundle#begin/end. | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'scrooloose/nerdtree' | |
Plugin 'kien/ctrlp.vim' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
editor = /usr/bin/vim | |
autocrlf = input | |
[alias] | |
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
lg3 = log --graph --abbrev-commit --decorate --date=relative --all | |
lg = !"git lg1" | |
[init] | |
templatedir = ~/.git-templates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This will remove the trailing whitespaces from the files and add it again to be committed. | |
# | |
# Put this into ~/.git-templates/hooks/pre-commit, and chmod +x it. | |
# Detect platform | |
platform="win" | |
uname_result=`uname` | |
if [ "$uname_result" = "Linux" ]; then |
CSPRNG (Cryptographically Secure Pseudo-Random Number Generator) functions:
os.urandom(n)
: return a string of n random bytes.random.SystemRandom()
: provides random functions that usesos.urandom()
.
Note: Don't use random
module for PRNG for security purposes.
OlderNewer