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
{
"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",
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 / MapsSampleData.kt
Created December 16, 2019 10:43
Sample data for the Android Google Maps project
private fun generateSampleData(): List<UserMap> {
return listOf(
UserMap(
"Memories from University",
listOf(
Place("Branner Hall", "Best dorm at Stanford", 37.426, -122.163),
Place("Gates CS building", "Many long nights in this basement", 37.430, -122.173),
Place("Pinkberry", "First date with my wife", 37.444, -122.170)
)
),
@rpandey1234
rpandey1234 / README.md
Created April 6, 2020 00:56
Tip Calculator README.md template

Tip Calculator

Your name here

Tippy computes the tip and total amount for a bill. The app uses the base amount and tip percentage to calculate the amount owed, and it also describes the quality of service based on the tip.

Time spent: X hours spent in total

Functionality

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]
@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)
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 / 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

@rpandey1234
rpandey1234 / activity_main.xml
Created June 13, 2020 14:42
Layout file for the Magic 8 Ball Android app
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:context=".MainActivity">
<TextView