Skip to content

Instantly share code, notes, and snippets.

View sshobotov's full-sized avatar

Serhii Shobotov sshobotov

View GitHub Profile
// 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
@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
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
{
+
"id" : "5a8aa7b1978d7400165fb30a",
+
// No app url
{"user_id":"KovalevEvtihii93225@mail.ru","session_id":"F1CD259A-9C73-4FC0-AE0E-C68CD35566F8","notification_type":"app_impression","device_id":"Od01","timestamp":"2018-01-30
03:19:35.4530","event":{"bodyText":"Wouldn’t you rather talk to your tech? The new Lenovo United States #Yoga920 hears and obeys your every word. #DifferentIsBetter","creative_id":"363590051","headerImage.uri":"http://itunes.apple.com/a
pp/id363590051?fbdata={\"app_id\":\"\",\"ref\":\"\"}&partnerId=30&siteID=9G.NUo1nRnw","attachments.media.playCount":"8785","attachments.actionLinks.title":"Learn More","attachments.actionLinks.destinationType":"LINK","attachments.media.
sdURL":"http://itunes.apple.com/app/id363590051?fbdata={\"app_id\":\"\",\"ref\":\"\"}&partnerId=30&siteID=9G.NUo1nRnw","feedback.reshares.totalCountValue":"4","attachments.media.playableURLString":"http://itunes.apple.com/app/id36359005
1?fbdata={\"app_id\":\"\",\"ref\":\"\"}&partnerId=30&siteID=9G.NUo1nRnw","attachments.actionLinks.linkVideoEndscreenIcon.uri":
{
"NewsFeedQueryDepth3": {
"response": {
"viewer": {
"news_feed": {
"edges": [
{
"__type__": {
"name": "NewsFeedEdge"
},
{
"NewsFeedQueryDepth3": {
"response": {
"viewer": {
"news_feed": {
"edges": [
{
"__type__": {
"name": "NewsFeedEdge"
},
# With proxy 67.205.142.183:8080
2017-10-16 13:31:36.972425 52:54:00:12:34:56 (oui Unknown) > 52:55:0a:00:02:02 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 64, id 17170, offset 0, flags [DF], proto TCP (6), length 60)
10.0.2.15.42871 > ec2-23-23-185-50.compute-1.amazonaws.com.https: Flags [S], cksum 0xb0ac (correct), seq 3323512658, win 65535, options [mss 1460,sackOK,TS val 1999936 ecr 0,nop,wscale 6], length 0
2017-10-16 13:31:37.214731 52:55:0a:00:02:02 (oui Unknown) > 52:54:00:12:34:56 (oui Unknown), ethertype IPv4 (0x0800), length 58: (tos 0x0, ttl 64, id 26401, offset 0, flags [none], proto TCP (6), length 44)
ec2-23-23-185-50.compute-1.amazonaws.com.https > 10.0.2.15.42871: Flags [S.], cksum 0xa6af (correct), seq 2588288001, ack 3323512659, win 8192, options [mss 1500], length 0
2017-10-16 13:31:37.214844 52:54:00:12:34:56 (oui Unknown) > 52:55:0a:00:02:02 (oui Unknown), ethertype IPv4 (0x0800), length 54: (tos 0x0, ttl 64, id 17171, offset 0, flags [DF], proto TCP (6), len
[1249941643,1.0,WrappedArray([https://graph.facebook.com/network_ads_common/,TEMPLATE_ID=103&SCREEN_WIDTH=768&OSVERS=8.1.2&NUM_ADS_REQUESTED=1&SCREEN_HEIGHT=1024&IDFA=12862AC5-3FF2-46F9-8039-4F5091C1AB34&APPVERS=1.0&SESSION_TIME=0.0449070930480957&UNITY=0&OS=iOS&REQUEST_TIME=1501551364.180486&SECURITY_DISABLED=1&PLACEMENT_ID=355125528237208_355126044903823&NETWORK_TYPE=1&CLIENT_EVENTS=&VOLUME=0&COCOS2D=0&BUNDLE=com.netpower.echoPlayer.lite&WIDTH=0&MODEL=iPad2%2C3&IDFA_FLAG=1&SDK=ios&SDK_CAPABILITY=%5B3%2C4%2C5%2C7%2C9%2C10%2C12%2C16%2C17%5D&ADAPTERS=AN&SDK_VERSION=4.24.0&DENSITY=1&LOCALE=en&APPBUILD=1&MAKE=Apple&SESSION_ID=AFDCC045-6863-4ACB-8B6B-E283706F6CD4&ORIENTATION=1&HEIGHT=0&COPPA=0], [https://graph.facebook.com/network_ads_common/,AFP=a5cd8c&TEMPLATE_ID=200&SCREEN_WIDTH=768&OSVERS=8.1.2&NUM_ADS_REQUESTED=1&SCREEN_HEIGHT=1024&IDFA=12862AC5-3FF2-46F9-8039-4F5091C1AB34&APPVERS=1.0&SESSION_TIME=1.021269083023071&UNITY=0&OS=iOS&REQUEST_TIME=1501551365.138401&SECURITY_DISABLED=1&PLACEMENT_ID=355125528237208
2017-04-19 09:12:20 GET http://ads.mopub.com/m/ad?v=6&id=7f75da19d5ae4ea7988c81b744109f77&nv=4.9.0&dn=unknown%2CAndroid%20SDK%20built%20for%20x86%2Cblackbird_phone_x86&bundle=com.apptopia.labs.tom.boilerpl
ate&z=%2B0300&o=l&w=1280&h=800&sc_a=1.0&mcc=310&mnc=260&iso=us&cn=Android&ct=3&av=0.0.1&udid=sha%3A32eb985e223ccf758f63c0ed415b947c5037d8b2&dnt=0&mr=1&android_perms_ext_storage=1
← 200 text/html 41B 502ms
Request Response Detail
User-Agent: Mozilla/5.0 (Linux; Android 5.1.1; Android SDK built for x86 Build/LMY48T) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Safari/537.36
Accept-Language: en