Skip to content

Instantly share code, notes, and snippets.

View mazurio's full-sized avatar

Damian Mazurkiewicz mazurio

View GitHub Profile
Fatal Exception: java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:112)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by rx.exceptions.OnErrorNotImplementedException
@mazurio
mazurio / AndroidManifest.xml
Created March 24, 2016 17:14 — forked from BrandonSmith/AndroidManifest.xml
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
{
"routine" : [
{
"title": "Warmup",
"type": "category"
},
{
"title": "Dynamic Stretches (Do all, 5-10 reps each)",
"type": "section"
},
@mazurio
mazurio / Presenter.java
Created June 8, 2015 15:02
Presenter in MVP (Android)
package io.mazur.presenter;
import java.io.Serializable;
import io.mazur.view.TestView;
public abstract class Presenter<T extends TestView> implements Serializable {
/**
* Transient is a Java keyword which marks a member variable not to be serialized when it is persisted to streams of bytes.
* When an object is transferred through the network, the object needs to be 'serialized'.
@mazurio
mazurio / gist:9cf04d08eea47778b52a
Created May 26, 2015 10:54
CMAKE set PKG_CONFIG_PATH inside CMakeLists.txt
set(ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/:$ENV{PKG_CONFIG_PATH}")
int x = 0;
while(x <= 10) {
printf("%d \n", x);
x++;
}
for(int i = 0; i <= 10; i++) {
printf("%d\n", i);
}
@mazurio
mazurio / gist:a9e294c689831dc54a58
Created April 19, 2015 17:53
Basic SDL2 Template for CMAKE
cmake_minimum_required(VERSION 3.0)
include(FindPkgConfig)
project(SDL01)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(SDL01 ${SOURCE_FILES})
@mazurio
mazurio / gist:5092dc53bd4a4db956a1
Created April 19, 2015 17:52
Basic SDL2 Template
#include <iostream>
#include <SDL.h>
using namespace std;
int main() {
if(SDL_Init(SDL_INIT_VIDEO) != 0) {
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
java.lang.IllegalStateException: onMoveItem() - may be a bug or has duplicate IDs --- mDraggingItemInitialPosition = 1, mDraggingItemCurrentPosition = 0, origFromPosition = 0, fromPosition = 1, toPosition = 0
at com.h6ah4i.android.widget.advrecyclerview.draggable.DraggableItemWrapperAdapter.moveItem(DraggableItemWrapperAdapter.java:294)
at com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager.swapItems(RecyclerViewDragDropManager.java:684)
at com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager.checkItemSwapping(RecyclerViewDragDropManager.java:534)
at com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager.handleScrollOnDragging(RecyclerViewDragDropManager.java:595)
at com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager$ScrollOnDraggingProcessRunnable.run(RecyclerViewDragDropManager.java:827)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:
@mazurio
mazurio / run.sh
Created February 25, 2015 12:04
Bash Android: Run gradle install flavour and send an intent to every device in order to launch application on all devices.
#!/bin/bash
# Runs gradle task installGoogleDebug and starts MainActivity on each available running device and emulator.
./gradlew installGoogleDebug &&
adb devices | while read line
do
if [ ! "$line" = "" ] && [ `echo $line | awk '{print $2}'` = "device" ]
then
device=`echo $line | awk '{print $1}'`
echo "Starting Application on device: $device $@ ..."
adb -s $device shell am start -n io.mazur.project/io.mazur.project.ui.MainActivity