Skip to content

Instantly share code, notes, and snippets.

View mancvso's full-sized avatar
🏠
Working from home

Alejandro Vidal Castillo mancvso

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mancvso on github.
  • I am avidal_c (https://keybase.io/avidal_c) on keybase.
  • I have a public key whose fingerprint is 0F7E AC6E E928 C047 B705 4C39 C6A5 B9BC EE72 FF3A

To claim this, I am signing this object:

// build.gradle
// implementation 'org.apache.commons:commons-vfs2:2.2'
// implementation 'net.idauto.oss.jcifs:vfs-jcifs-ng:1.0.1'
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemManager;
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.VFS;
import org.apache.commons.vfs2.auth.StaticUserAuthenticator;
import org.apache.commons.vfs2.impl.DefaultFileSystemConfigBuilder;
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;
Grammatical endings, affixes, correlatives:
-a adjective
-e adverb
-j plural
-n accusative
-o noun
Verbs:
@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 {
@mancvso
mancvso / keybase.md
Created April 19, 2015 17:31
Keybase

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 August 26, 2013 13:55
JavaFX run on UI thread
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 June 18, 2013 07:07
LaTeX + Inconsolata + Bitstream Charter = Perfection
% 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 December 14, 2015 20:58 — 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).
// --- 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