Skip to content

Instantly share code, notes, and snippets.

View rcgonzalezf's full-sized avatar
🎯
Focusing

Roberto Carlos Gonzalez Flores rcgonzalezf

🎯
Focusing
View GitHub Profile
@rcgonzalezf
rcgonzalezf / AndrStudioShortcuts.md
Created April 9, 2024 16:29
Useful Android shortcuts for Mac

I haven't build muscle memory for the following shortcuts, I'll add them here for an easy reference.

  1. SHIFT + CMD + F12 -> Get rids of everything, cleans your AS UI.
  2. SHIFT + CMD + (, ) -> Stretch to left or Strech to right.
  3. ALT + ↑ -> Expand selection.
  4. SHIFT + CMD + B -> Clipboard history.
  5. ALT + SHIFT + (,) -> Moving text (not Cut & Paste).
  6. SHIFT + CMD +T -> Refactor.
  7. ALT + CMD + O -> Go to Symbol.
  8. SHIFT + CMD + O -> Go to File.
@rcgonzalezf
rcgonzalezf / Gephi.thread.dump.java
Created August 31, 2023 16:24
Thread dump, experiencing the Gephi #2546 issue.
73146:
2023-08-31 09:22:18
Full thread dump OpenJDK 64-Bit Server VM (11.0.17+8 mixed mode):
Threads class SMR info:
_java_thread_list=0x0000600003d005e0, length=30, elements={
0x00007fea24808800, 0x00007fea4401a800, 0x00007fea24809000, 0x00007fea55847800,
0x00007fea5402c800, 0x00007fea1400a800, 0x00007fea1480a800, 0x00007fea55176800,
0x00007fea55253000, 0x00007fea54392800, 0x00007fea55493800, 0x00007fea14808800,
0x00007fea1481b000, 0x00007fea1404f000, 0x00007fea24835000, 0x00007fea554fb800,
@rcgonzalezf
rcgonzalezf / Genymotion with Charles Proxy.md
Created September 14, 2019 06:45
Genymotion with Charles Proxy

Charles Proxy in your Genymotion Android emulator

  1. Settings -> Wifi -> Press and hold your active network
  2. Select “Modify Network”Select “Show Advanced Options”
  3. Select “Proxy Settings -> Manual”
  4. Set your Proxy to: 10.0.3.2 (Genymotion’s special code for the local workstation)
  5. Set your Port to: 8888
  6. Press Save
@rcgonzalezf
rcgonzalezf / NavigateBack.kt
Created September 14, 2019 05:22
Navigate Back
package lavanderia.org.lavanderia
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.support.v4.app.NavUtils
import android.support.v4.app.TaskStackBuilder
import android.support.v7.app.ActionBarDrawerToggle
import android.support.v7.app.AppCompatActivity
import android.view.MenuItem
@rcgonzalezf
rcgonzalezf / FuelOkHttpClientForHttpPatch.kt
Created February 7, 2018 07:55
FuelOkHttpClientForHttpPatch sample using OkHttpClient
package com.rcgonzalezf.example.common.network
import com.github.kittinunf.fuel.core.Client
import com.github.kittinunf.fuel.core.FuelError
import com.github.kittinunf.fuel.core.Request
import com.github.kittinunf.fuel.core.Response
import okhttp3.MediaType
import okhttp3.OkHttpClient
import okhttp3.RequestBody
import java.io.ByteArrayInputStream
@rcgonzalezf
rcgonzalezf / ExampleFragment.kt
Last active March 10, 2020 11:40
Fragment new Instance in Kotlin
package org.rcgonzalezf.kotlin
import android.os.Bundle
import android.support.v4.app.Fragment
class ExampleFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// More logic here
@rcgonzalezf
rcgonzalezf / Problem2.kt
Created August 11, 2017 08:35
Trying to achieve pure functions with Kotlin.
package org.rcgonzalezf.onetoten
import java.math.BigInteger
/**
*
* https://projecteuler.net/problem=2
*
* Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
*
@rcgonzalezf
rcgonzalezf / MainActivity.java
Created September 17, 2016 02:10
Help for Progress Bar
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
@rcgonzalezf
rcgonzalezf / aftertask.gradle
Created August 2, 2016 01:38
Generate code coverage. If on a mac, the afterTask will open the results in the default browser when you use the openinbrowser=true param.
/*
# source: https://www.reddit.com/r/androiddev/comments/3ig3gm/show_us_your_gradle_tasks/cugju7z
usage:
./gradlew jacocoTestReport -Popeninbrowser=true #opens in browser
./gradlew jacocoTestReport #does not open in browser
*/
configurations {
jacocoReport
}
@rcgonzalezf
rcgonzalezf / Answers for Exercises
Created February 20, 2016 20:35
Pragmatic Programmer - Orthogonality
You should check the definition of the authors, I'm sharing my answers here to generate discussion if you think is worth it.
The questions are on page 43 of my edition this might be different on your edition,
I'll only post my answers so please check the questions on the book.
1. Split2 is more orthogonal because it hides the details of the implementation to its consumers.
2. Modeless in general are less dependant of the context so for me this is more orthogonal, and usually a modal dialog depends on the actions or state of the caller, so if you change the caller code or the actions the caller can perform the modal dialog might have to be updated too, leading this type of dialog to be less orthogonal.
3. I'll say procedural,... In theory Object Oriented technology is more orthogonal because it hides the implementation and the state of the code, in procedural more often when you change one of the dependencies it might lead to an undesired impact on the program overall.
At the end in my point of view it dep