Skip to content

Instantly share code, notes, and snippets.

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

Renato Souza renatovieiradesouza

🏠
Working from home
View GitHub Profile
@thalespupo
thalespupo / ActRobot.kt
Last active May 9, 2019 18:36
AAA + TestingRobot + Kotlin DSL
package com.tapura.podmorecasts
import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.action.ViewActions.pressImeActionButton
import android.support.test.espresso.matcher.ViewMatchers.withId
class ActRobot {
fun clickOkInSearchBar() {
onView(withId(android.support.design.R.id.search_src_text)).perform().perform(pressImeActionButton())
}
@srayhunter
srayhunter / android-update-commandline.md
Last active September 18, 2023 13:13
Android - Update Android SDK from the commandline

Android - Update Android SDK from the commandline

Update the installed packages

sdkmanager --update

List all items (--all is needed to show obsolete, build tools and other items)

sdkmanager --list
@arianimartins
arianimartins / MainActivity.java
Created April 30, 2014 19:21
Efeito Fade-in e Fade-out na transição de telas ou fragments
//Em Activity
Intent i = new Intent(MainActivity.this, Destino.java);
startActivity(i);
overridePendingTransition(R.anim.fadein, R.anim.fadeout);
// Em fragments (provavelmente já possúi um código parecido com este)
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.setCustomAnimations(R.anim.fadein, R.anim.fadeout); //animação aqui
transaction.commit();
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active July 18, 2024 07:57
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost