Skip to content

Instantly share code, notes, and snippets.

View happysingh23828's full-sized avatar
🎯
Focusing

Happy Singh happysingh23828

🎯
Focusing
View GitHub Profile
@fpersson
fpersson / setup.java
Created December 5, 2011 22:09
Android: Copy raw resources to external storage
package photo.mission;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import android.content.Context;
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@vasanthk
vasanthk / System Design.md
Last active July 30, 2024 00:17
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@lopspower
lopspower / README.md
Last active July 31, 2024 22:25
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@kaeawc
kaeawc / codecov.yml
Last active December 20, 2021 13:15
Jacoco settings for multi module multi flavor Kotlin Android app
codecov:
branch: master
bot: null
coverage:
precision: 2
round: down
range: "70...100"
status:
public class MySwipeToRefresh extends SwipeRefreshLayout {
private int mTouchSlop;
private float mPrevX;
public MySwipeToRefresh (Context context, AttributeSet attrs) {
super(context, attrs);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
}
@happysingh23828
happysingh23828 / BaseSectionFragment.kt
Last active September 4, 2020 06:39
set view height when show soft keyboard is open
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
mView = inflater.inflate(R.layout.fragment_base_section, container, false)
KeyboardUtil(requireActivity(), mView.coordinatorLayout)
return mView
}
@happysingh23828
happysingh23828 / Extensions.kt
Last active January 24, 2023 07:46
Kotlin extension for applying Spannable text on any textview and getting callback for onclick.
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.text.TextPaint
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.view.View
import androidx.appcompat.widget.AppCompatTextView
fun AppCompatTextView.highLightWord(word: String, onClick: () -> Unit) {
val ssBuilder = SpannableStringBuilder(this.text)
@happysingh23828
happysingh23828 / install
Created January 4, 2021 07:09
Install Android bundle on connected device using bundletool.jar
// generate app-release.apks
java -jar bundletool-all-1.4.0.jar build-apks --local-testing --bundle=app-release.aab --output=app-release.apks --connected-device
// Install apk from genrated app-release apks
java -jar bundletool-all-1.4.0.jar install-apks --apks app-release.apks