Skip to content

Instantly share code, notes, and snippets.

View defHLT's full-sized avatar
🐔

Artem Kholodnyi defHLT

🐔
View GitHub Profile
@defHLT
defHLT / RxFirebase.java
Created May 24, 2016 16:57 — forked from gsoltis/RxFirebase.java
RxJava Bindings for Firebase
package com.firebase.client;
import com.firebase.client.core.Constants;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action0;
import rx.functions.Func1;
import rx.subscriptions.Subscriptions;
public class RxFirebase {
adb shell screenrecord /sdcard/v.mp4
adb pull /sdcard/v.mp4 v.mp4
avconv -i v.mp4 -r 24 frame%005d.png
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.util.Pair;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.subscriptions.Subscriptions;
GooglePlusContactsSync E Failed to clear out contacts
E java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{4a8bb85 28657:com.google.android.apps.plus/u0a79} (pid=28657, uid=10079) requir
es android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
E at android.os.Parcel.readException(Parcel.java:1620)
E at android.os.Parcel.readException(Parcel.java:1573)
E at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3550)
E at android.app.ActivityThread.acquireProvider(ActivityThread.java:4783)
E at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2018)
E at android.content.ContentResolver.acquireUnstableProvider(Content
import rx.Observable.Operator;
import rx.Subscriber;
import rx.exceptions.Exceptions;
import rx.functions.Func2;
/**
* Created by Artem Kholodnyi on 3/23/16.
*/
/**
package rx.android.observables;
import rx.Observable;
import rx.Observable.OnSubscribe;
import rx.Subscriber;
import rx.android.subscriptions.AndroidSubscriptions;
import rx.functions.Action0;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@defHLT
defHLT / flavor_names_build.gradle
Created November 16, 2015 11:03 — forked from keyboardsurfer/flavor_names_build.gradle
Version names for application variants
android {
applicationVariants.all { variant ->
def flavor = variant.mergedFlavor
def name = flavor.getVersionName()
def versionName = name + '-' + variant.properties.get('flavorName')
if (variant.buildType.isDebuggable()) {
versionName += '-debug';
}
flavor.versionName = versionName;
}
class CubesWithVboWithStride extends Cubes {
final int mCubeBufferIdx;
CubesWithVboWithStride(float[] cubePositions, float[] cubeNormals, float[] cubeTextureCoordinates, int generatedCubeFactor) {
FloatBuffer cubeBuffer = getInterleavedBuffer(cubePositions, cubeNormals, cubeTextureCoordinates, generatedCubeFactor);
// Second, copy these buffers into OpenGL's memory. After, we don't need to keep the client-side buffers around.
final int buffers[] = new int[1];
GLES20.glGenBuffers(1, buffers, 0);
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://repos.zeroturnaround.com/nexus/content/repositories/zt-public-releases'
}
}
dependencies {
float[] result = new float[3];
Location.distanceBetween(
-33.947730, 25.559675,
-33.94772833333333, 25.55967333333333,
result
);
Log.d("distance", "" + result[0]);