Skip to content

Instantly share code, notes, and snippets.

View rodgarcialima's full-sized avatar

Rodrigo G Lima rodgarcialima

View GitHub Profile
@emil2k
emil2k / Connectivity.java
Last active August 5, 2024 10:48
Android utility class for checking device's network connectivity and speed.
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@mislavs
mislavs / BooksAdapter
Created October 29, 2014 19:58
RecyclerView.Adapter implementation for displaying a list of Book objects.
package com.msvs.bookshelf.adapters;
import android.os.Handler;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
@mihkels
mihkels / MultiConnectionSupport.java
Created March 2, 2016 13:51
Spring Boot with Letsencrypt SSL certificate support
@Configuration
public class MultiConnectionSupport {
@Value("${server.port}")
private int serverPort;
@Value("${server.http.port}")
private int httpServerPort;
@Bean
public EmbeddedServletContainerFactory servletContainer() {
@Chetan496
Chetan496 / instructionsToStartJBOSSinDebugMode.md
Last active November 21, 2022 16:21
Starting JBOSS in Debug mode

How to start JBoss in Debug mode to allow remote debugging via socket?

By default, remote debugging is not enabled. You can enable it - default port is 8787.

In the file standalone.conf.bat in the <JBOSS_HOME>/bin folder, just uncommnet the following line:

rem Sample JPDA settings for remote socket debugging set "JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"

@wader
wader / Makefile
Created April 11, 2017 18:54
libchromaprint.js
# make sure chromaprint source is in $PWD/chromaprint
# after run use $PWD/chromaprint/libchromaprint.min.js
# does not use --bind and set NO_DYNAMIC_EXECUTION to generate code
# that don't use eval
CC = emcc
CXX = em++
CFLAGS = -O2 -DUSE_KISSFFT=1 -Isrc -Ivendor/kissfft
CXXFLAGS = -O2 -std=c++11 -DUSE_KISSFFT=1 -Isrc -Ivendor/kissfft
package rodgarcialima.task;
public class AsyncTaskActivity {
private void download() {
new Task1<Integer, List<Product>>(
top -> { // receive 10 here
Response<List<Product>> response = apiService.getProducts(top).execute();
if (response.isSuccessful()) {
return response.body();
}