Skip to content

Instantly share code, notes, and snippets.

View swapnil20711's full-sized avatar
👨‍💻
swap0

Swapnil bhojwani swapnil20711

👨‍💻
swap0
  • JECRC UNIVERSITY , JAIPUR
  • Jaipur, India
View GitHub Profile
import org.jsoup.Jsoup
fun main() {
val doc =
Jsoup.connect("https://www.linkedin.com/posts/amazon_opportunities-for-software-development-activity-6980143102367862784-8YA7?utm_source=share&utm_medium=member_android")
val element = doc.get().getElementById("main-content")
?.getElementsByClass("core-rail mx-auto papabear:w-core-rail-width mamabear:max-w-[790px] babybear:max-w-[790px]")!![0].allElements[1].getElementsByClass("share-native-video").first()
?.getElementsByClass("share-native-video__node video-js")?.first()!!.attr("data-sources")
println(element)
}
@swapnil20711
swapnil20711 / Modfun.kt
Created August 9, 2022 10:47
Android live template for composable with modifier
@androidx.compose.runtime.Composable
fun $NAME$(modifier:Modifier = androidx.compose.ui.Modifier.$PARAM$) {
$END$
}
/**
* Clicking will elicit a different response depending on the state.
* This method determines the state and proceeds with the correct action.
*/
private fun clickLemonImage() {
// TODO: use a conditional statement like 'if' or 'when' to track the lemonadeState
// when the image is clicked we may need to change state to the next step in the
// lemonade making progression (or at least make some changes to the current state in the
// case of squeezing the lemon). That should be done in this conditional statement
@swapnil20711
swapnil20711 / index.js
Created November 30, 2020 09:29
Cloud functions to push notifications android
const functions = require('firebase-functions');
// The Firebase Admin SDK to access Cloud Firestore.
const admin = require('firebase-admin');
admin.initializeApp();
// Take the text parameter passed to this HTTP endpoint and insert it into
// Cloud Firestore under the path /messages/:documentId/original
exports.addMessage = functions.https.onRequest(async (req, res) => {
// Grab the text parameter.