Skip to content

Instantly share code, notes, and snippets.

⚛️
Writing React components.

Douglas Nassif Roma Junior douglasjunior

View GitHub Profile
@douglasjunior
douglasjunior / README.md
Last active Mar 3, 2019
Configure seu Fishshell para exibir informações sobre o repositório Git, assim como no Zsh.
View README.md
@douglasjunior
douglasjunior / flex-box.html
Created Aug 14, 2018
Exemplo de layout com flexbox.
View flex-box.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Layout com Flexbox</title>
<style>
html,
body {
@douglasjunior
douglasjunior / IOSWifiManager.h
Last active Sep 17, 2018 — forked from rbresjer/IOSWifiManager.h
Programatically join Wi-Fi network on iOS with React Native wrapper for NEHotspotConfiguration
View IOSWifiManager.h
// Created by Rutger Bresjer on 10/10/2017
// Notes:
// - Be sure to enable "Hotspot Configuration" capability for the iOS target
// - Make sure the NetworkExtension framework is linked to the target
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
@interface IOSWifiManager : NSObject <RCTBridgeModule>
View Começando com Node JS e Express.md

Começando com Node JS e Express

  1. Instalar o Node JS 6.10 ou 6.11: https://nodejs.org/en/

  2. Verifique se o Node e o NPM foram instalados corretamente.

    Para verificar a versão do NPM:

    npm --version 
View TooltipGenerator.java
/**
* Created by douglas on 02/05/16.
*/
public final class TooltipGenerator {
private Activity activity;
private Dialog dialog;
private Context context;
private List<SimpleTooltip> tooltips = new ArrayList<>();
View EscPosHelper.java
import android.graphics.Bitmap;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
/**
* Created by douglas on 29/05/17.
* Adapted from http://new-grumpy-mentat.blogspot.com.br/2014/06/java-escpos-image-printing.html
*/
@douglasjunior
douglasjunior / TUTORIAL_LETSENCRYPT_GLASSFISH4.md
Last active Jan 23, 2019
Tutorial de instalação do Lets Encrypt no Glassfish 4.x
View TUTORIAL_LETSENCRYPT_GLASSFISH4.md

Tutorial de instalação do Lets Encrypt no Glassfish 4.x

Gerando certificado Lets Encrypt

Para gerar o certificado Lets Encrypt é muito simples, aqui as instruções estão baseadas em um tutorial publicado pela Locaweb. (Web archive)

Primeiro vamos criar um diretório para isso:

@douglasjunior
douglasjunior / Connectivity.java
Created Sep 12, 2016 — forked from emil2k/Connectivity.java
Android utility class for checking device's network connectivity and speed.
View Connectivity.java
package com.emil.android.util;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Check device's network connectivity and speed
* @author emil http://stackoverflow.com/users/220710/emil
@douglasjunior
douglasjunior / MyActivity.java
Last active Oct 11, 2018
Allows RecyclerView work like a FlowLayout.
View MyActivity.java
public class MyActivity extends Activity {
public void onCreate(...){
RecyclerView rv = findViewByIdCast(R.id.rv);
// 2 is the number of columns
rv.setLayoutManager(new GridLayoutManager(this, 2));
// Calculates the width of the "CardView" dynamically.
int cardViewWidth = getResources().getDimension(R.dimen.my_cardview_width) + getResources().getDimension(R.dimen.my_cardview_margin) * 2;
rv.getViewTreeObserver().addOnGlobalLayoutListener(new OnFlowLayoutListener(rv, cardViewWidth));
}
@douglasjunior
douglasjunior / ProgressRequestBody.java
Created Feb 19, 2016
Class used to monitoring the file upload progress in Retrofit2 library.
View ProgressRequestBody.java
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okio.BufferedSink;
You can’t perform that action at this time.