Skip to content

Instantly share code, notes, and snippets.

View VladSumtsov's full-sized avatar

Vladyslav Sumtsov VladSumtsov

View GitHub Profile
{
"type": {
"value": "playlist"
},
"entry": [
{
"type": {
"value": "video"
},
"id": "IfLGdOMF2222",
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" type="static" mediaPresentationDuration="PT0H14M48.00S" timeShiftBufferDepth="PT1S" minimumUpdatePeriod="PT1H" maxSegmentDuration="PT3S" minBufferTime="PT1S" profiles="urn:mpeg:dash:profile:isoff-live:2011,urn:com:dashif:dash264">
<Period id="1" start="PT0S">
<AdaptationSet group="1" lang="en_stereo" mimeType="audio/mp4" minBandwidth="130358" maxBandwidth="130358" segmentAlignment="true">
<Representation id="128kbps en" bandwidth="130358" codecs="mp4a.40.2" audioSamplingRate="48000">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<SegmentTemplate timescale="48000" duration="95232" media="audio/stereo/en/128kbit/segment_$Number$.m4s" initialization="audio/stereo/en/128kbit/init.mp4" sta
@VladSumtsov
VladSumtsov / Threads logger
Last active March 30, 2017 14:08
Android, rx threads logger. Helps to debug threads problem.
public void printThreadCountByName(String name) {
Set<Thread> threadSet = getAllStackTraces().keySet();
Observable.from(threadSet)
.filter(thread -> thread.getName().toLowerCase().contains(name.toLowerCase()))
.groupBy(Thread::isAlive)
.flatMap(t -> t)
.groupBy(Thread::getState)
.flatMap(Observable::toList)
.subscribe(list -> {
if (list.isEmpty()) {
@VladSumtsov
VladSumtsov / FlowUtils.java
Created March 30, 2017 06:07
Override view states for flow
package de.dom.android.ui.util;
import android.content.Context;
import android.os.Parcelable;
import android.util.SparseArray;
import android.view.View;
import java.lang.reflect.Field;
import java.util.ArrayDeque;
import java.util.Deque;
package de.dom.android.ui.widget;
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@VladSumtsov
VladSumtsov / SoundPoolHelper.java
Created November 2, 2016 09:20
helper for playing sounds
package com.grasshopper.dialer.util;
import android.content.Context;
import android.media.AudioManager;
import android.media.SoundPool;
import android.support.annotation.RawRes;
import java.util.HashMap;
import java.util.Map;
@VladSumtsov
VladSumtsov / ListByListFilter.java
Last active December 22, 2016 15:28
Rx list filter. Use this filter to filter list by other list or by internal list
package com.grasshopper.dialer.util;
import android.support.annotation.NonNull;
import java.util.List;
import rx.Observable;
import rx.functions.Func1;
/**
@VladSumtsov
VladSumtsov / BaseTest.java
Last active September 2, 2016 18:38
Mock janet commands
package com.ghm.util;
import com.ghm.TestGHMApplication;
import com.ghm.di.AppComponent;
import com.ghm.di.AppModule;
import com.ghm.di.MockCommandService;
import com.ghm.di.TestApiModule;
import com.ghm.di.TestJanetModule;
import com.ghm.service.api.CreatePSTNCallAction;
package com.ghm.ui.view;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.res.TypedArray;
import android.os.Build;
package com.ghm.mortar;
import android.app.Activity;
import android.app.SearchManager;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.DrawableRes;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;