Skip to content

Instantly share code, notes, and snippets.

View cristianovagos's full-sized avatar
🤙
What's up?

Cristiano Vagos cristianovagos

🤙
What's up?
View GitHub Profile
@dgomes
dgomes / main.py
Last active July 31, 2019 08:51
Workshop TTN - Movimento Maker Portugal
import pycom
from network import LoRa
import time
import binascii
import socket
from machine import Pin
from onewire import DS18X20
from onewire import OneWire
// Simple stack implementation, works as expected every time
private Stack<NavItem> navigationStack = new Stack<>();
// ...
// Navigating to a new screen/item in the stack
navigationStack.push(new NavItem(viewToBeAdded.getClass(), args));
// ...
@yiyocx
yiyocx / RxMediaPlayer.java
Last active March 1, 2024 15:46
Android MediaPlayer class meets RxJava. This class was based in the example of the blog post: http://adelnizamutdinov.github.io/blog/2015/01/23/using-rxjavas-observable-semantics-for-greater-good/ but was updated to use fromCallable(), pure Java 7 (no retrolambda), notifies elapsed and total time when starts playing audio. It supports streaming …
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.support.annotation.NonNull;
import android.support.v4.util.Pair;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
@Mariovc
Mariovc / ImagePicker.java
Last active June 13, 2024 11:49
Utility for picking an image from Gallery/Camera with Android Intents
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
/*
MIT License
Copyright (c) 2015 Adel Nizamutdinov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
package com.lukehorvat;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Parcel;
import android.os.Parcelable;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.NumberPicker;