Skip to content

Instantly share code, notes, and snippets.

View ramiloif's full-sized avatar

Rami Loiferman ramiloif

View GitHub Profile
"One morning, when Gregor Samsa woke from troubled dreams, " +
"he found himself transformed in his bed into a horrible vermin. He lay on " +
"his armour-like back, and if he lifted his head a little he could see his " +
"brown belly, slightly domed and divided by arches into stiff sections. " +
"The bedding was hardly able to cover it and seemed ready to slide off any moment. " +
"His many legs, pitifully thin compared with the size of the rest of him, " +
"waved about helplessly as he looked. “What’s happened to me? “ he thought. " +
"It wasn’t a dream. His room, a proper human room although a little too small, " +
"lay peacefully between its four familiar walls. A collection of textile samples " +
"lay spread out on the table - Samsa was a traveling salesman - and above it there " +
@ramiloif
ramiloif / FlowReduce.kt
Last active March 17, 2021 13:14
reduce in Kotlin Flow sample
suspend fun main(args: Array<String>) {
sample(flowOf(1, 2, 3))
}
suspend fun sample(numbers: Flow<Int>): Int {
return numbers.reduce { acc, value ->
acc + value
}
}
insertId jsonPayload.logger jsonPayload.message jsonPayload.context jsonPayload.thread resource.type resource.labels.location resource.labels.pod_name resource.labels.project_id resource.labels.namespace_name resource.labels.container_name resource.labels.cluster_name timestamp severity labels."k8s-pod/team" labels."compute.googleapis.com/resource_name" labels."k8s-pod/version" labels."k8s-pod/app" labels."k8s-pod/pod-template-hash" logName receiveTimestamp
wr383og4le7u2c reactor.netty.http.server.HttpServerOperations [id: 0x3e475a0d, L:/1.1.1.1.1:8080 - R:/2.2.2.2.2:53498] Last HTTP packet was sent, terminating the channel default reactor-http-epoll-4 k8s_container europe-west1-b product-service-d7b9dc4b5-spxst env-integration default product-service env-integration-cluster-v2 2021-03-10T10:05:12.319Z DEBUG teamA gke-env-integrat-nap-n1-standard--a87874fe-evvt v1 product-service d7b9dc4b5 projects/env-integration/logs/stdout 2021-03-10T10:05:17.028863653Z
wr383og4le7u2b reactor.netty.http.server.HttpServerOp
let number = 0;
let temp;
const inc = () => new Promise(resolve => {
setTimeout(() => {
temp = number;
number = temp + 1;
resolve();
}, 4000)
});
@ramiloif
ramiloif / fakeCall.sh
Last active August 19, 2020 04:07
Make the broadcast receiver to receive a missed or answered call
phoneNumber=$1
echo Faking answered call to $phoneNumber
adb shell am broadcast -a android.intent.action.PHONE_STATE --es state "RINGING" --es incoming_number $phoneNumber
adb shell am broadcast -a android.intent.action.PHONE_STATE --es state "OFFHOOK" --es incoming_number $phoneNumber
adb shell am broadcast -a android.intent.action.PHONE_STATE --es state "IDLE" --es incoming_number $phoneNumber