Skip to content

Instantly share code, notes, and snippets.

@walidum
walidum / link.txt
Last active Jun 7, 2021
Link to drive
View link.txt
@walidum
walidum / to.json
Created Jun 2, 2021
Data path "" must NOT have additional properties(styleext).
View to.json
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
@walidum
walidum / from.json
Created Jun 2, 2021
Data path "" must NOT have additional properties(styleext).
View from.json
"schematics": {
"@schematics/angular:application": {
"strict": true
},
"@schematics/angular:component": {
"styleext": "scss"
}
},
View java.java
//Demo.java
public static String httpClient() {
HttpClient httpClient = HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_2)
.connectTimeout(Duration.ofSeconds(20))
.build();
HttpRequest httpRequest = HttpRequest.newBuilder()
.GET()
.uri(URI.create("https://jsonplaceholder.typicode.com/todos/1"))
.build();
@walidum
walidum / java.java
Created May 23, 2021
Collection to an Array
View java.java
//Demo.java
public static String[] collectiontoArray() {
var sampleList = Arrays.asList("Algiers", "Setif");
return sampleList.toArray(String[]::new);
}
//DemoTest.java
@Test
public void collectiontoArrayTest() {
assertTrue(Arrays.equals(Demo.collectiontoArray(), new String[]{"Algiers", "Setif"}));
@walidum
walidum / java.java
Created May 23, 2021
New File Methods
View java.java
//Demo.java
public static String newFileMethods() {
String home = System.getProperty("user.home");
Path filePath = Paths.get(home, "test.txt");
try {
Files.writeString(filePath, "Hello World !!");
return Files.readString(filePath);
} catch (IOException e) {
return "";
}
@walidum
walidum / java.java
Last active May 23, 2021
New String Methods
View java.java
//Demo.java
public static List<String> newStringMethods (){
String multilineString = "All Algeria \n \n Java \n Community.";
return multilineString.lines()
.filter(line -> !line.isBlank())
.map(String::strip)
.collect(Collectors.toList());
}
//DemoTest.java
@walidum
walidum / js.js
Created May 12, 2021
explication
View js.js
before calling the api "api/requestride" you have to call this new api to get all the availble categories :
you can check this screenshot : https://trello-attachments.s3.amazonaws.com/5fd72c7f63214e10a993c085/5fd76009f0c11f2fe8dc0d59/59b804115822931142d40052774cf2e4/Screenshot_20210104-154130_Wesselni.jpg
POST : api/grabrides
params :
{
user_id:'',
pickup_location:'',
pickup_lat:'',
pickup_lng:'',
drop_location:'',
View exemple.java
Map<String, String> map = new HashMap<>();
map.put("phonenumber", phoneNumber);
map.put("newpassword", newpassword);
FirebaseUser mUser = FirebaseAuth.getInstance().getCurrentUser();
mUser.getIdToken(true)
.addOnCompleteListener(new OnCompleteListener<GetTokenResult>() {
public void onComplete(@NonNull Task<GetTokenResult> task) {
if (task.isSuccessful()) {
String idToken = task.getResult().getToken();
@walidum
walidum / component.ts
Created May 5, 2021
Angular animations
View component.ts
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css'],
animations: [
// animation triggers go here
]
})