Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
keep jammin', keep coding 🎸

Gustavo Cavalieri Fernandes gugacavalieri

💭
keep jammin', keep coding 🎸
View GitHub Profile
@gugacavalieri
gugacavalieri / connect.js
Last active Jul 23, 2020
AWS Neptune - Gremlin - JS
View connect.js
const gremlin = require('gremlin');
const { traversal } = gremlin.process.AnonymousTraversalSource;
const { DriverRemoteConnection } = gremlin.driver;
const graph = traversal().withRemote(new DriverRemoteConnection('ws://graphdb:8182/gremlin', {}));
module.exports = { graph }
@gugacavalieri
gugacavalieri / HelloVO.kt
Created Mar 24, 2020
Kotlin Data Class with Interface
View HelloVO.kt
data class HelloVO (val property: String) {
interface IHello {
fun `say hello`()
}
}
View TogglzUserFeatureImpl.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.togglz.core.Feature;
import org.togglz.core.context.FeatureContext;
import org.togglz.core.manager.FeatureManager;
import org.togglz.core.repository.FeatureState;
import org.togglz.core.spi.ActivationStrategy;
import org.togglz.core.user.SimpleFeatureUser;
public enum TogglzUserFeatureImpl implements Feature {
@gugacavalieri
gugacavalieri / IPromotionsView.java
Last active Mar 25, 2018
Android M.V.P Tests With Robolectric
View IPromotionsView.java
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.widget.Toolbar;
/**
* Created by gustavo on 11/28/17.
*
* Interface for defining a Promotions View
*
@gugacavalieri
gugacavalieri / AutoCompleteColorAdapter.java
Last active Jan 4, 2017
Android AutoComplete Custom Adapter
View AutoCompleteColorAdapter.java
import android.content.Context;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Filter;
import android.widget.ImageView;
View EndlessRecyclerOnScrollListener.java
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
/**
* Class for extending Recycler view functionality
* Allows for fetching more data when user reaches end of view!
*/
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();