Skip to content

Instantly share code, notes, and snippets.

View mazurio's full-sized avatar

Damian Mazurkiewicz mazurio

View GitHub Profile
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: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}")
@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'.
{
"routine" : [
{
"title": "Warmup",
"type": "category"
},
{
"title": "Dynamic Stretches (Do all, 5-10 reps each)",
"type": "section"
},
@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"
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