Skip to content

Instantly share code, notes, and snippets.

View robsenshuu's full-sized avatar
✌️
Hello!

Robert Avalos robsenshuu

✌️
Hello!
View GitHub Profile

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@robsenshuu
robsenshuu / HomeActivity.kt
Created September 22, 2020 17:15 — forked from antoniolg/HomeActivity.kt
Snackbar extensions on Kotlin, to create a useful small DSL.
class HomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
setSupportActionBar(toolbar)
fab.setOnClickListener {
it.snack("Snack message") {
action("Action") { toast("Action clicked") }
@robsenshuu
robsenshuu / AppSignatureHelper
Created July 12, 2020 22:38
This class give us the key for SMS Verification
import android.content.Context
import android.content.ContextWrapper
import android.content.pm.PackageManager
import android.util.Base64
import android.util.Log
import java.nio.charset.StandardCharsets
import java.security.MessageDigest
import java.security.NoSuchAlgorithmException
import java.util.*
import kotlin.collections.ArrayList
Go to Settings -> Editor -> File and Code Templates -> Includes -> File Header
#set( $USER = "Your name" )
/**
* Created by ${USER} on ${DATE}.
*/
import android.content.Context
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.util.AttributeSet
import android.widget.ImageView
import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory
class CircularImageView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
class CutCopyPasteEditText @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : EditText(context, attrs, defStyleAttr) {
interface OnCutCopyPasteListener {
fun onCut()
fun onCopy()
fun onPaste()
}
[{
"CityEnglish": "Osaka",
"CityJapanese": "大阪府",
"Place": [{
"PlaceNameJapanese": "大阪城",
"PlaceNameEnglish": "Osaka Castle",
"AddressJapanese": "〒540-0002 大阪市中央区大阪城1-1",
"AddressEnglish": "1-1 Ōsakajō, Chūō-ku, Ōsaka-shi, Ōsaka-fu 540-0002",
"AddressLink": "https://goo.gl/maps/ybSYKFR28KM2"
},
/* Large desktops and laptops */
@media (min-width: 1200px) {
}
/* Landscape tablets and medium desktops */
@media (min-width: 992px) and (max-width: 1199px) {
}
# Go to C:\xampp\apache\conf\extra open http-vhost.conf file and add:
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\envioclickpro\public"
ServerName name-of-your-host.dev
ServerAlias http://name-of-your-host.dev
</VirtualHost>
# Go to C:\Windows\System32\drivers\etc open host file and add:
# If you installed mysql via homebrew and mysql gives you the error
# ERROR 1067 (42000) at line 22: Invalid default value for 'some_date_field'
# You must open the mysql config file located in /usr/local/etc/my.cnf and add the next line
sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
# After, you have to restar mysql and that's it
brew services restart mysql