Skip to content

Instantly share code, notes, and snippets.

View rpandey1234's full-sized avatar
🎯
Helping engineers grow their careers

Rahul Pandey rpandey1234

🎯
Helping engineers grow their careers
View GitHub Profile
@rpandey1234
rpandey1234 / README.md
Created September 22, 2020 23:13
Github README for bigger number demo

Bigger Number App

Your name here

Bigger Number App (aka "Cal Admission Test") prompts the user to select which of the two numbers presented is larger. The background color is updated depending on if the correct answer is chosen. New numbers are randomly selected after a user selection.

Time spent: X hours spent in total

Functionality

data class ExamResult(val name: String, val score: Int)
fun main() {
runTests()
}
// Return "A" if the score is b/w 90 and 100
// "B" if the score is b/w 80 and 89
// "C" if the score is b/w 70 and 79
// "F" for anything else
data class ExamResult(val name: String, val score: Int)
fun main() {
runTests()
}
// Return "A" if the score is b/w 90 and 100
// "B" if the score is b/w 80 and 89
// "C" if the score is b/w 70 and 79
// "F" for anything else
@rpandey1234
rpandey1234 / MainActivity.kt
Created November 26, 2020 19:03
Update of Tippy Project to Android Studio 4.1 (no more kotlin android extensions)
class MainActivity : AppCompatActivity() {
// ADD VIEW VARIABLE DECLARATIONS HERE
private lateinit var tvTipPercent: TextView
private lateinit var etBase: EditText
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// SET THE VIEWS HERE
tvTipPercent = findViewById(R.id.tvTipPercent)
import android.content.Context
import android.widget.ImageView
import android.widget.Toast
import com.bumptech.glide.Glide
// From the Kotlin docs
fun <T> MutableList<T>?.swap(index1: Int, index2: Int) {
if (this == null) return
val tmp = this[index1] // 'this' corresponds to the list
this[index1] = this[index2]
{
"videos": [{
"name": "[Case Study] Building A Meta Internal Tool To Empower An Entire Org: Staff Promotion Story",
"img": "https://firebasestorage.googleapis.com/v0/b/tech-career-growth.appspot.com/o/thumbnails%2FTaroPremiumSessions%2Fpremium_session_2_updated.png?alt=media&token=1e1432b5-b1f2-4b29-be27-8d0bab06cca2&w=1920&q=75",
"tags": [
"Meta",
"Performance Review"
],
"views": "9.5K Views",
"likes": "77 Likes",