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
| DgaAuthenticationConfigs dgaAuthenticationConfigs = new DgaAuthenticationConfigs(); | |
| String user = "test"; | |
| String password = "senha"; | |
| StringReader stringReader = new StringReader("{ \"username\": \" " + user + "\", \"password\": \"" + password + "\" }"); | |
| WebTarget authenticationTarget = ClientWrapperUtil.getWebTarget("https:\\someurl"); | |
| Response authenticationResponse = authenticationTarget.path("service").request(MediaType.APPLICATION_JSON) | |
| .post(Entity.json(stringReader)); | |
| String token = authenticationResponse.readEntity(String.class); |
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
| # first: mkdir user && cd user && cp /path/to/get_gists.py . | |
| # python3 get_gists.py user | |
| import requests | |
| import sys | |
| from subprocess import call | |
| user = sys.argv[1] | |
| r = requests.get('https://api.github.com/users/{0}/gists'.format(user)) |
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
| #mapping for clob int hbm | |
| <property name="somename" type="string"> | |
| <column name="somename" sql-type="clob"/> | |
| </property> | |
| #similar to into the class. | |
| @Lob | |
| private String somename; |
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
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import java.io.IOException; | |
| import org.junit.Test; | |
| import static org.junit.Assert.assertNotNull; | |
| public class ResponseTest { | |
| @Test |
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
| #Atribute Directives | |
| #only affect the element they are added, have () for events or [] for attributes | |
| #Structure Directives | |
| #has a leading *, a whole area of the DOM are affected |
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
| #its agood practice to impelment the interface OnInit, OnChanges and so on. | |
| #ngOnChanges: several called, in start , and after some change,Called after a bound input property changes | |
| ngOnChanges(changes: SimpleChanges){ | |
| console.log('ngOnChanges called!'); | |
| console.log(changes); | |
| } | |
| #ngOnInit: once the component is initialized, not displayed yet, afeter the constructor runs | |
| #ngDoCheck: called during every change dection run, even if doesnt happen some change, just a click | |
| #does that | |
| #ngAfterContentInit: Called after content(ng-content) has been projected into view |
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
| #the angular 8 encapsulate the css to the module | |
| # it uses a marker to make that | |
| # meaning if you want to change this behavior you do in the component desired in the atribute encapsulation | |
| #change to not use any of the encapsulation, meaning that the css will affect globally | |
| ... | |
| @Component{ | |
| ... | |
| encapsulation: ViewEncapsulation.none | |
| ... | |
| } |
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
| #component comunication | |
| #input to the componeent | |
| #needs to add the @Input from import { Input } from '@angular/core'; | |
| #sample | |
| ... | |
| @Input() element: {type: string, name: string, content: string}; | |
| ... | |
| #this allows a comunication like below, because if not , the element should be availiable outside the component | |
| <app-server-element | |
| *ngFor="let element of serverElements" |
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
| #augury , chrome tool to help to debug angular 8 soluctions(may be earlier also) |
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
| #using bootstrap | |
| #install it | |
| npm i --save bootstrap | |
| #change into the angular.json the entry to point to bootstrap | |
| ... | |
| "my-first-app": { | |
| ... | |
| "architect": { | |
| "build": { | |
| ... |
NewerOlder