Skip to content

Instantly share code, notes, and snippets.

Avatar
🌃
Learning at home

Carlos Cepeda CarlosACepeda

🌃
Learning at home
View GitHub Profile
@CarlosACepeda
CarlosACepeda / git-commit-author-rewrite.md
Created Sep 24, 2020 — forked from trey/git-commit-author-rewrite.md
Change the email address for a git commit.
View git-commit-author-rewrite.md

Change the email address for a git commit.

$ git commit --amend --author="Author Name <email@address.com>"

or

$ git commit --amend --reset-author
@CarlosACepeda
CarlosACepeda / KeyboardUtils.java
Created Oct 24, 2019 — forked from lopspower/KeyboardUtils.java
Force Hide Keyboard Android
View KeyboardUtils.java
import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
public class KeyboardUtils {
public static void hideKeyboard(Activity activity) {
View view = activity.findViewById(android.R.id.content);
View StaticContextLeak.java
package pl.pszklarska.leakexample;
import android.content.Context;
import android.widget.Toast;
public class StaticContextLeak {
private static Context context;
public void setContext(final Context context) {
@CarlosACepeda
CarlosACepeda / convertanicon.cs
Created Mar 28, 2018
This is a snippet in how to Convert <Android.Graphics.Drawables.Icon> to <Android.Graphics.Drawables.Drawable> [c#] [Android][Xamarin.Android]
View convertanicon.cs
//Static: No need to make an instance to call this method.
// Receives two arguments:
//Icon: the Icon to convert:
//Paquete: Package of the app where the icon resides, needed to retrieve an icon from another application.
public static Drawable ReturnActionIconDrawable(Icon icon, string paquete)
{
//New Context field.
Context remotePackageContext = null;
//Create a context using the package passed in <paquete>
You can’t perform that action at this time.