Skip to content

Instantly share code, notes, and snippets.

View vishalwayachal's full-sized avatar

Vishal Wayachal vishalwayachal

View GitHub Profile
@Plumillon
Plumillon / PFRecyclerViewAdapter.java
Last active April 1, 2022 07:29
Simpler generic RecyclerView.Adapter and RecyclerView.ViewHolder with click listener
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ilkinulas
ilkinulas / DialogBuilder.kt
Created February 26, 2017 13:09
Kotlin Builder Pattern
class Dialog private constructor(
val title: String,
val message: String,
val titleColor: Color,
val bodyColor: Color,
val icon: Image,
val onClose: () -> Unit) {
fun show() {
//...
@daupawar
daupawar / VcfGenerator.kt
Last active April 1, 2022 10:49
Generate Fake VCF file in kotlin
fun main(args: Array<String>) {
val charPool : List<Char> = ('a'..'z') + ('A'..'Z') + ('0'..'9')
repeat(2) {
val rand = Random()
val stringBuilder = StringBuilder()
stringBuilder.append("BEGIN:VCARD")
stringBuilder.append("\n")
stringBuilder.append("VERSION:3.0")
@vishalwayachal
vishalwayachal / vsfGenerator.js
Last active April 6, 2022 09:46
Generate Fake VCF file in JAVASCRIPT
loopindex = 100
vcftext = ``
function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < 5; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));