Skip to content

Instantly share code, notes, and snippets.

View sshobotov's full-sized avatar

Serhii Shobotov sshobotov

View GitHub Profile
window.webviewbridge = new (function(gameId, appName, appVersion, viewUrl, viewHash, viewVersion, sessionStart, idfa, deviceId, gamerId) {
var mock = {
__initialized: false,
"com.unity3d.ads.api.Sdk": {
loadComplete: function() {
var configUrl = "https://config.unityads.unity3d.com/webview/2.0.5/release/config.json"
return [gameId, false, appName, appVersion, 2005, "2.0.5", false, configUrl, viewUrl, viewHash, viewVersion, sessionStart, false]
},
initComplete: function() {
mock.__initialized = true
@sshobotov
sshobotov / RunningMedian.scala
Last active February 13, 2020 01:08
Playing around with coding problems
/*
Constraints
* 1 <= n <= 2*10^5
* 1 <= d <= n
* 0 <= expenditure[i] <= 200
*/
def activityNotifications(expenditure: Array[Int], d: Int): Int = {
if (expenditure.size <= d)
0
// Could be any other storage like FireBase, also could be some in-memory storage
// but will have to make some retries more often if state is lost
import { createClient } from 'redis'
class RedisConnection {
#client = null
async client() {
if (this.#client != null)
return this.#client