Skip to content

Instantly share code, notes, and snippets.

Alejandro Vidal Castillo mancvso

Block or report user

Report or block mancvso

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
package com.polidea.rxandroidble.sample.example4_characteristic;
import android.bluetooth.BluetoothGattCharacteristic;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
View dense_en-eo
Grammatical endings, affixes, correlatives:
-a adjective
-e adverb
-j plural
-n accusative
-o noun
public F.Promise<Usuario> findById(String id) {
F.RedeemablePromise<Usuario> promise = F.RedeemablePromise.empty();
usuarios.find( eq("_id", id) ).first( (u, e) -> { // FIXME: Single field query
System.out.println("dispatching callback...");
if(u == null || e != null){
promise.failure( new Throwable("no user"));
} else {

Keybase proof

I hereby claim:

  • I am mancvso on github.
  • I am mancvso ( on keybase.
  • I have a public key whose fingerprint is 4B2B 437B CD4A 812A 6ED8 1A80 C6F1 96B9 2BAB C75E

To claim this, I am signing this object:

mancvso / gist:6341664
Created Aug 26, 2013
JavaFX run on UI thread
View gist:6341664
Platform.runLater(new Runnable() {
public void run() {
//Execute some script to hide a div
mancvso / gist:5803243
Created Jun 18, 2013
LaTeX + Inconsolata + Bitstream Charter = Perfection
View gist:5803243
% sudo apt-get install texlive-fonts-extra texlive-fonts-recommended
mancvso / WhenUnlessOtherwise.scala
Last active Dec 14, 2015 — forked from joa/gist:5141649
when / unless / otherwise implementation in Scala with some Implicit Value Classes and call by name (deferred evaluation only when necessary).
View WhenUnlessOtherwise.scala
// --- Shorter with Option[T] --- //
implicit class WhenUnless[T](x: => T) {
lazy val xx = x
def when(cond: => Boolean):Option[T] = if(cond) Some(xx) else None
def unless(cond: => Boolean):Option[T] = if(cond) None else Some(xx)
implicit class Otherwise[+T](val x: Option[T]) extends AnyVal {
def otherwise[S >: T](z: => S):S = if(x.isDefined) x.get else z //could not use getOrElse
You can’t perform that action at this time.