Skip to content

Instantly share code, notes, and snippets.

View johnatanbrayan's full-sized avatar
🏠
Working from home

Johnatan Brayan johnatanbrayan

🏠
Working from home
View GitHub Profile
@johnatanbrayan
johnatanbrayan / Create a launcher on linux
Created September 26, 2020 00:09
Create a launcher image on linux ubuntu
# Create a launcher on directory /usr/share/applications
vim /usr/share/applications/app-name.desktop
# Create a file app-name.desktop and edit with exemple below:
[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA Ultimate Edition
Icon=/opt/idea/bin/idea.svg
@johnatanbrayan
johnatanbrayan / Install intellij by tar.gz on linux
Last active September 26, 2020 15:05
How to install intellij by archive tar.gz on linux
# Open the directory /opt
cd /opt/
# Decompile the intellij archive
sudo tar -xvzf ~/Downloads/ideaIC-2020.2.tar.gz
# Change the name for better manipulation
sudo mv idea-IC-202.6397.94 idea
# Run the executable file
@johnatanbrayan
johnatanbrayan / circle-button.css
Created September 26, 2020 22:27
Custom status button with interactivity
.btn {
font-size: 0.9rem;
&.btn-circle {
width: 35px;
height: 35px;
text-align: center;
padding: 6px 0;
font-size: 15px;
line-height: 1.428571429;
@johnatanbrayan
johnatanbrayan / viacep.ts
Created September 26, 2020 22:38
Script to search and fill in the address inputs automatically by searching by zip code on angular 10
// Install NgxViaCep with npm and follow the installation instructions
// Link: https://www.npmjs.com/package/@brunoc/ngx-viacep
constructor(private viacep: NgxViacepService) {}
/* ------------------------------------- CEP ------------------------------------ */
buscarCep(): void {
let cep: string = this.registerForm.get(['cep'])!.value;
if (cep) {
@johnatanbrayan
johnatanbrayan / example-jhipster.jh
Last active September 27, 2020 01:26
One example of JDL Jhipster
entity Objet1 {
atributo1 String
atributo2 String
status Boolean
}
entity Objet2 {
atributo1 String
atributo2 String
status Boolean
@johnatanbrayan
johnatanbrayan / check-toggle.css
Created September 27, 2020 03:19
One example of the check toggle with html and css
/* ------------------------------ STATUS TOGGLE--------------------------------- */
li.borderless {
border-top: 0 none;
}
.check-box-scged > input[type='checkbox'] {
display: none;
}
.check-box-scged > label {
@johnatanbrayan
johnatanbrayan / example-mask.html
Created September 27, 2020 03:31
Example mask on angular
<div class="form-group col-md-3">
<label class="form-control-label" name="cpf">CPF</label>
<input type="text" class="form-control" name="cpf" id="cpf" for="cpf"
[textMask]="maskCpf" formControlName="cpf" required>
<div *ngIf="editForm.get('cpf')!.invalid && (editForm.get('cpf')!.dirty || editForm.get('cpf')!.touched)">
<small class="form-text text-danger"
*ngIf="editForm.get('cpf')?.errors?.required">
This field is required.
</small>
@johnatanbrayan
johnatanbrayan / Configure connection database on spring boot
Created October 7, 2020 01:08
Tutorial to configure connection database on spring boot:
# Edit application.properties and insert one of all this script below:
## Postgresql:
### Obs: Must to create a database and user on postgresql cliente before to execute this script.
spring.jpa.database=POSTGRESQL
spring.datasource.url=jdbc:postgresql://localhost/projectNameDatabase
spring.datasource.username=projectName
spring.datasource.password=projectName
@johnatanbrayan
johnatanbrayan / Install and Configure Mysql on Linux
Created October 7, 2020 02:41
Tutorial to install mysql on linux and configure mysql on spring project
## Install:
sudo apt update
sudo apt install mysql
## Configure:
sudo mysql -u root -p
USE mysql;
SELECT User, Host, plugin='mysql_native_password' WHERE User='root';
FLUSH PRIVILEGES;
exit;
@johnatanbrayan
johnatanbrayan / Config gitflow init
Created October 29, 2020 14:57
How to configure gitflow init
# Config gitflow init
master
develop
feature/
release/
hotfix/
support/
bugfix/