Skip to content

Instantly share code, notes, and snippets.

View 4gus71n's full-sized avatar

Agustín Tomas Larghi 4gus71n

  • Myself
  • Mar del Plata
View GitHub Profile
//Example 1...
//I want to get data from the server-side
mRepository.getDogsFromServerSide()
//If there's no internet connection I want to plug the database cache
.onErrorResumeNext(ObservableUtils.whenExceptionIs(UnknownHostException.class, mDogsCache.getAllDogs()))
//If something goes wrong on the server-side I want to plug the memory cache
.onErrorResumeNext(ObservableUtils.whenExceptionIs(ServerSideException.class, mMemoryDogsCache.getAllDogs()))
//I want to turn each Dog into a Cat
.map(new Func1<DataSource<List<Dog>>, DataSource<List<Cat>>>() {
@Override
<html>
<header>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
function dec2bin(dec){
return (dec >>> 0).toString(2);
}
function generateUrls(baseN) {
public class ISO8601DateAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {
public ISO8601DateAdapter() {
}
@Override
public Date deserialize(JsonElement json, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
if (!(json instanceof JsonPrimitive)) {
throw new JsonParseException("The date should be a string value");
}
Date date = deserializeToDate(json);
package com.siplay.android_siplay.helper;
/*
* Copyright 1999,2004 The Apache Software Foundation.
*
* 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
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.google.gson.JsonSyntaxException;
import net.misove.mypvrcommon.serialization.ISO8601DateParser;
<html>
<body>
<ul>
<li><a href="siplay://invite/team/SS-66666666">SI PLAY invite/team/SS-6666666 (Bad team guid)</a></li>
<li><a href="siplay://addteammates/SS-960269">AddTeamMembers to NoSoyTeamAdmin's Team (Prod) (NEW)</a></li>
<li><a href="siplay://addteammates/SS-923586">AddTeamMembers to Agu's Team (Prod) (NEW)</a></li>
@4gus71n
4gus71n / index.html
Last active June 18, 2018 17:39
Testing Dapps
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js/dist/web3.min.js"></script>
<script>
$( document ).ready(function() {
var Web3 = require('web3');
var address = "0xcbbfbafedb0eb83016d2a96a4e80d30b20fa3e30"
@4gus71n
4gus71n / flattenArrays.kt
Created September 12, 2018 23:40
A simple code challenge
// Feel free to run it here try.kotlinlang.org
fun main(args: Array<String>) {
val testCollection = arrayOf(
1, 2, 3,
arrayOf(4, 5, emptyArray<Int>()), null,
arrayOf(emptyArray<Int>(), emptyArray<Int>()),
arrayOf(6)
)
$('head').append('<style type="text/css">crawler_selected{ background:#FFFF00; }</style>');
$(document).click(function(event){
event.preventDefault()
$(event).addClass("crawler_selected")
console.log(event.target)
});