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
View App.java
package com.polidea.rxandroidble.sample.example4_characteristic;
import android.bluetooth.BluetoothGattCharacteristic;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
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
Verbs:
View MongoAsyncDriverPromise.java
@Override
public F.Promise<Usuario> findById(String id) {
F.RedeemablePromise<Usuario> promise = F.RedeemablePromise.empty();
System.out.println("querying...");
usuarios.
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 {
View keybase.md

Keybase proof

I hereby claim:

  • I am mancvso on github.
  • I am mancvso (https://keybase.io/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
mancvso / gist:6341664
Created Aug 26, 2013
JavaFX run on UI thread
View gist:6341664
Platform.runLater(new Runnable() {
@Override
public void run() {
//Execute some script to hide a div
webEngine.executeScript("document.getElementById('myDiv').style.display='none';");
}
});
@mancvso
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
\documentclass[10pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{charter}
\usepackage[T1]{fontenc}
\usepackage{inconsolata}
\usepackage{hyperref}
@mancvso
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.