This file contains 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
var number = 100000000000000000000; | |
console.log(number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')); | |
regex: (/\B(?=(\d{3})+(?!\d))/g, ',') |
This file contains 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
gcc your_program.c && ./a.out |
This file contains 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
describe("Validing User Login", () => { | |
it("should return true if login is valid", () => { | |
const loginVar = "jonas@gmail.com"; | |
const senhaVar = "123456"; | |
function login(loginp: string, passwordp: string) { | |
return loginp && passwordp.length > 4; | |
} | |
expect(login(loginVar, senhaVar)).toBe(true); | |
}); | |
}); |
This file contains 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
for create package.json | |
yarn init -y | |
convert typescript to js more fast than babel and add ts | |
yarn add -D typescript sucrase | |
create folder src and add server.ts there | |
create into package.json | |
"scripts": { |
This file contains 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
In CMD linked in your project folder: | |
yarn create react-app . --template typescript | |
yarn add -D eslint-config-prettier eslint-plugin-prettier @typescript-eslint/eslint-plugin @typescript-eslint/parser | |
yarn add styled-components |
This file contains 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
How open a JFrame in center of monitor with JAVA | |
---CODE--- | |
import java.awt.Dimension; | |
import java.awt.Toolkit; | |
import javax.swing.JFrame; |
This file contains 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
#get an image | |
sudo docker pull redis:6.0.10-alpine | |
#List images | |
sudo docker images | |
#run an image | |
sudo docker run -d -p 6379:6379 -i -t redis:6.0.10-alpine | |
#list the image who is running | |
sudo docker ps | |
#close the image and procces of BD | |
sudo docker stop <ID> |
This file contains 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
#COPY BY diego3g | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
export ANDROID_HOME=~/Android/Sdk | |
export PATH="$PATH:$ANDROID_HOME/tools" | |
export PATH="$PATH:$ANDROID_HOME/platform-tools" | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/diegofernandes/.oh-my-zsh" |
This file contains 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
:root { | |
--color-background: #121214; | |
--color-green: #04d361; | |
--color-red: #e83f5b; | |
--color-orange: #fd951f; | |
--color-yellow: #f7df1e; | |
--color-primary: #8257e6; | |
--color-primary-hover: #9466ff; | |
--color-secondary: #e1e1e6; | |
--color-text: #a8a8b3; |