Skip to content

Instantly share code, notes, and snippets.

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

Júnior César Abreu juniorcesarabreu

🏠
Working from home
View GitHub Profile
@juniorcesarabreu
juniorcesarabreu / debug-wifi.md
Created January 8, 2019 18:56
Android – Debug de aplicação via WiFi usando ADB sem precisar de root
  1. Desconectar o seu dispositivo do computador, caso esteja.

  2. Conectar o seu computador de desenvolvimento e o seu dispositivo Android na mesma rede WiFi.

  3. Habilitar o modo desenvolvedor em seu dispositivo (Configurações > Sobre > Apertar 7 vezes em Número da versão).

  4. Habilitar a depuração USB (Configurações > Programador > Depuração USB).

  5. Obtenha o IP do seu dispositivo em Configurações > Sobre > Status > Endereço IP.

public class MoneyTextWatcher implements TextWatcher {
    private final WeakReference<EditText> editTextWeakReference;
    private final Locale locale;

    public MoneyTextWatcher(EditText editText, Locale locale) {
        this.editTextWeakReference = new WeakReference<EditText>(editText);
        this.locale = locale != null ? locale : Locale.getDefault();
    }
@juniorcesarabreu
juniorcesarabreu / How to Install Older version of Chrome Extensions.md
Last active March 10, 2024 17:11
How to Install Older version of Chrome Extensions
@juniorcesarabreu
juniorcesarabreu / sharing-folder-windows-macos-vmware.md
Created March 30, 2020 22:16
Sharing a folder between windows and mac os x on vmware

You need to follow this procedure in order to share files between Windows 7 and Mac OS X on VMWare :

  1. Go in your virtual machine settings and select 'Options' tab.
  2. Click on 'Folder Sharing' and tick 'Always enabled'.
  3. Click on 'Add' button and select a folder you want to share.
  4. Confirm virtual machine settings.
  5. From 'System preferences' on Mac OS X, select 'Sharing'.
  6. Make sure that 'File Sharing' is enabled.
  7. From top menu bar, select 'Go' and 'Computer'.
  8. You will now see a folder named '/'. This is your shared folder between Windows 7 and Mac OS X.
@juniorcesarabreu
juniorcesarabreu / Upload images to a gist.md
Last active November 22, 2023 15:09
How do you upload images to a gist?

How do you upload images to a gist?

  1. Create a gist or reuse one of your gists.
  2. Clone your gist:
git clone https://gist.github.com/<hash>.git
  1. Add your image to your gist's repository:
@juniorcesarabreu
juniorcesarabreu / memset.md
Last active November 17, 2023 12:05
A função memset(str, c, n) copia o caracter c (um unsigned char) para os n primeiros caracteres da string apontada por str.

Exemplo

#include <stdio.h>
#include <string.h>

int main ()
{
   char str[50];

 strcpy(str,"This is string.h library function");

DEL as key shortcut for delete emails on Gmail

Alt + 127
@juniorcesarabreu
juniorcesarabreu / Soft keyboard with comma instead of dot for decimal separator in android.md
Created February 26, 2018 18:44
Soft keyboard with comma instead of dot for decimal separator in android

You can use the following workaround to also include comma as a valid input:-

Through XML:

<EditText
    android:inputType="number"
    android:digits="0123456789.," />

Programmatically:

@juniorcesarabreu
juniorcesarabreu / SharedPreferences.android.md
Created February 18, 2018 15:34
Android Shared preferences example

Create SharedPreferences

SharedPreferences pref = getApplicationContext().getSharedPreferences("MyPref", MODE_PRIVATE); 
Editor editor = pref.edit();

Storing data as KEY/VALUE pair

Assuming you have GIMP 2.8 installed to the default directory, you can do this via a registry script created by David L. To add the 'Edit with GIMP' option to system image types, save the following as a .reg file and run it.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\Edit with GIMP]