Skip to content

Instantly share code, notes, and snippets.

View monday8am's full-sized avatar
🙃
meehh

Angel Anton monday8am

🙃
meehh
View GitHub Profile
public abstract class ViewModelBase : MvxViewModel
{
protected void ClearStackAndShowViewModel<TViewModel>()
where TViewModel : ViewModelBase
{
var presentationBundle = new MvxBundle(new Dictionary<string, string> { { PresentationBundleFlagKeys.ClearStack, "" } });
ShowViewModel<TViewModel>(presentationBundle: presentationBundle);
}
}
@pommedeterresautee
pommedeterresautee / Activity1.java
Last active April 11, 2017 15:10
Here is a simple implementation of a wrapper to execute Observable in a dedicated Fragment. The main purpose is to manage screen rotation during the Async execution of an Observable. In my application several Activities implement the Observer Interface, without Fragment, so this implementation is built with that in mind. Of course, it can be upd…
package com.pommedeterresautee.rxtest;
import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;
import rx.Observer;
@tomgibara
tomgibara / Tracker.java
Created May 18, 2011 03:51
A wrapper around Google analytics tracker for Android
package com.tomgibara.android.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import android.os.AsyncTask;
import android.os.SystemClock;
import com.google.android.apps.analytics.GoogleAnalyticsTracker;
@chriseidhof
chriseidhof / json.swift
Last active March 21, 2019 07:45
Reflection
import Cocoa
struct Person {
var name: String = "John"
var age: Int = 50
var dutch: Bool = false
var address: Address? = Address(street: "Market St.")
}
struct Address {
@gigamonkey
gigamonkey / criteria.txt
Last active January 5, 2020 06:21
Hiring criteria: looking for the ability to …
Write a program that does what it’s supposed to do
Write idiomatic code
Debug a program that you wrote
Debug a program someone else wrote
Debug the interaction between a system you wrote and one you didn’t
File a good bug report
Modify a program you didn’t write
Test a program you wrote
Test a program you didn’t write
Learn a new programming language
@dmarcato
dmarcato / Main.java
Last active May 21, 2020 10:25
De/Serialization of generic SparseArray using Gson library
import android.util.SparseArray;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
public class Main {
public static class MyCustomClass {
public int a;
@ulhas
ulhas / fastfile
Created March 20, 2016 02:58
Fastfile for HyperTrack iOS SDKs
fastlane_version "1.57.0"
require 'fileutils'
default_platform :ios
platform :ios do
desc "Increment framework version"
private_lane :increment_framework_version do |lane|
@dinorahtovar
dinorahtovar / bitbucket-pipelines.yml
Created January 12, 2019 00:29
Bitbucket Pipeline Android
image: java:8
pipelines:
branches:
deployment:
- step:
caches:
- gradle
- android-sdk
@xnoreq
xnoreq / unsharp.glsl
Last active October 17, 2021 09:31
Unsharp sharpen glsl shader
//!HOOK SCALED
//!BIND HOOKED
#define effect_width 1
#define coeff_blur 0.9
#define coeff_orig (1 + coeff_blur)
#define Src(a,b) HOOKED_texOff(vec2(a,b))
@chrisbanes
chrisbanes / CoroutineLifecycleObserver.kt
Last active September 9, 2022 14:07
LifecycleObserver which allows easy cancelling of coroutines
/*
* Copyright 2018 Google LLC
*
* 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
*
* Unless required by applicable law or agreed to in writing, software