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 {CanDeactivate, Router} from '@angular/router'; | |
import {Injectable} from '@angular/core'; | |
import {Observable} from 'rxjs/Observable'; | |
import {Observer} from 'rxjs/Observer'; | |
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material'; | |
export interface CanComponentDeactivate { | |
canDeactivate: () => Observable<boolean> | Promise<boolean> | boolean; | |
} |
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
# Declare variable | |
command=$1 | |
increment=5% | |
icon_name="" | |
display_volume=0 | |
# Increse volume | |
if [ "$command" = "up" ]; then | |
pactl set-sink-volume @DEFAULT_SINK@ +$increment | |
fi |
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
export GAE_PATH=/data/project-name/gae-json-keys | |
export GAE_KEY=/data/project-name/gae-json-keys/project-name.json | |
cp -rf $GAE_PATH/tbm-dev/* ./ | |
cd $WORKSPACE | |
mvn clean install | |
# 1 - WS AUTH | |
if [ "$WS_AUTHEN_AUTHORIZE" = "true" ]; then | |
if [ -d "$WORKSPACE/ws-authen-authorize" ]; then |
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
Map<String, Object> dataModel = new HashMap<>(); | |
dataModel.put("messages1", "a"); | |
dataModel.put("messages2", "b"); | |
try { | |
Configuration cfg = new Configuration(Configuration.VERSION_2_3_26); | |
cfg.setDirectoryForTemplateLoading(new File("/home/local/xinh.nguyen/Gitlab/mycode/src/main/resources/template/mail")); | |
String body = FreeMarkerTemplateUtils.processTemplateIntoString( | |
cfg.getTemplate("candidate_pipeline_template.ftl"), |
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
// primitive types | |
@Column | |
private Boolean isOpen; | |
// reference types | |
@Column | |
private boolean open; |
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
// org.hibernate.validator.constraints | |
// javax.validation.constraints | |
ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); | |
Validator validator = factory.getValidator(); | |
Set<ConstraintViolation<User>> constraintViolations = validator.validate(user); | |
for (ConstraintViolation<User> constraint : constraintViolations) { | |
System.out.println(constraint.getPropertyPath() + " " | |
+ constraint.getMessage()); | |
} |
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
@JsonCreator | |
public static EJobStatus create (String value) { | |
if(value == null) { | |
return null; | |
} | |
for(EJobStatus v : values()) { | |
if(value.equals(v.toString())) { | |
return v; | |
} | |
} |
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 java.beans.BeanInfo; | |
import java.beans.IntrospectionException; | |
import java.beans.Introspector; | |
import java.beans.PropertyDescriptor; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.InvocationTargetException; | |
public class Example { | |
public static void main(String[] args) |
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 io.reactivex.Observable; | |
import java.util.Arrays; | |
import java.util.List; | |
public class ExampleRxJava { | |
public static void main(String[] args) { | |
List<String> symbols = Arrays.asList("GOOG", "AMZN", "ITC"); | |
Observable<StockInfo> feed = StockServer.getFeed(symbols); |
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
// | |
ParameterizedTypeReference<ResponseBean<List<JobHiringPipelineDTO>>> responseType = new ParameterizedTypeReference<ResponseBean<List<JobHiringPipelineDTO>>>() {}; | |
ResponseEntity<ResponseBean<List<JobHiringPipelineDTO>>> exchange = restTemplate.exchange( | |
"http://localhost:8082/list-job-hiring-pipeline", | |
HttpMethod.GET, | |
null, | |
responseType); | |
ResponseBean<List<JobHiringPipelineDTO>> jobHiringPipelineDTOS = exchange.getBody(); |