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
const queryResponse = await container.items.query( | |
"SELECT * FROM c WHERE c.id='" + newItemId + "'").toArray(); | |
console.log(queryResponse.result[0].name); |
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
// Called through: | |
// http://127.0.0.1:3000/db?username=%27%20OR%20%271%27=%271 | |
// Query username from URL parameter | |
const username = req.query.username; | |
// Create SQL query | |
const sqlQuery = "SELECT * FROM c WHERE c.name='" + username + "'"; | |
// -> SQL Query is: SELECT * FROM c WHERE c.name='' OR '1'='1' |
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
// Delete item | |
const deleteResponse = await container.item(newItemId).delete(); | |
console.log(deleteResponse.item.id); | |
// Read all items from the container | |
const docResponse = await container.items.readAll().toArray(); | |
res.send(docResponse); |
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
<resources> | |
<string name="app_name">Digital Healthcare Explained</string> | |
</resources> |
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
<speak><mark name="gesture:wave"/>Welcome to Digital Healthcare Explained. <mark name="gesture:self"/>I will answer <mark name="gesture:you"/>your questions for several exciting healthcare topics!</speak> |
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
<break time="500ms"> |
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
// Retrofit | |
implementation 'com.squareup.retrofit2:retrofit:2.5.0' | |
implementation "com.squareup.retrofit2:converter-moshi:2.5.0" | |
implementation "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2" | |
// Moshi | |
implementation "com.squareup.moshi:moshi:1.8.0" | |
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.8.0" | |
// Kotlin Coroutines |
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
{ | |
"parts": [ | |
{ | |
"id": 100411, | |
"itemName": "LED Green 568 nm, 5mm" | |
}, | |
{ | |
"id": 101119, | |
"itemName": "Aluminium Capacitor 4.7μF" | |
}, |
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
package com.andresjakl.partslist | |
import com.squareup.moshi.JsonClass | |
@JsonClass(generateAdapter = true) | |
data class PartData ( var id: Long, var itemName: String) |
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
package com.andresjakl.partslist | |
import kotlinx.coroutines.Deferred | |
import retrofit2.Response | |
import retrofit2.http.* | |
interface PartsApiClient { | |
@GET("parts") fun getPartsAsync(): Deferred<Response<List<PartData>>> | |
@POST("parts") fun addPartAsync(@Body newPart : PartData): Deferred<Response<Void>> | |
@DELETE("parts/{id}") fun deletePartAsync(@Path("id") id: Long) : Deferred<Response<Void>> |