Skip to content

Instantly share code, notes, and snippets.

Avatar
🎮
Gaming

rajin Rajin9601

🎮
Gaming
View GitHub Profile
View installLiveTemplates.sh
#!/usr/bin/env bash
# Install Live Templates
BASEDIR=$( cd "$( dirname $0 )" && pwd )
echo "Select Android Studio Directory"
select folder in ~/Library/Preferences/AndroidStudio*;
do test -n "$folder" && break; echo "Invalid Selection"; done
View syncLiveTemplates.sh
#!/usr/bin/env bash
# Sync Live Templates to repo
BASEDIR=$( cd "$( dirname $0 )" && pwd )
echo "Select Android Studio Directory"
select folder in ~/Library/Preferences/AndroidStudio*;
do test -n "$folder" && break; echo "Invalid Selection"; done
@Rajin9601
Rajin9601 / live-template-for-kotlin-function-logging.md
Created Apr 27, 2020
intellij live template for kotlin function logging
View live-template-for-kotlin-function-logging.md
  1. create a live template (I use logf for log function)

  2. fill template text with

android.util.Log.i("$tag$", "$content$")
  1. click edit variables and type in expression for the variables

tag :

@Rajin9601
Rajin9601 / CenterAlignedTextView.kt
Last active Jul 13, 2019
CenterAlignedTextView
View CenterAlignedTextView.kt
package me.rajin.centeralignedtextview
import android.content.Context
import android.graphics.Rect
import android.graphics.Typeface
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.text.TextPaint
import android.text.style.CharacterStyle
import android.text.style.UpdateAppearance
View CenterAlignedLabel.swift
//
// CenterAlignedTextView.swift
// Created by Rajin on 11/06/2019.
//
import Foundation
import UIKit
/**
* Vertical center alignment label.
* In sketch, text alignment center exists while iOS/Android does not.
@Rajin9601
Rajin9601 / DaggerTest.kt
Last active Jul 20, 2018
Dagger Component Overriding test
View DaggerTest.kt
fun test() {
val testAComponent = DaggerTestA_Component.builder()
.parentComponent(object: TestA.ParentComponent {
})
.build()
val testBComponent = DaggerTestB_Component.builder()
.parentComponent(testAComponent)
.build()
val testInjected = TestInjected()