This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void consoleWriteLine(String message, Object... data){ | |
if(message.contains("{0}") && data.length > 0){ | |
int di = 0; | |
for(Object o : data){ | |
message = message.replace("{"+di+"}",String.valueOf(o)); | |
di++; | |
} | |
} | |
System.out.println(message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cyberavanza.chat.model; | |
import android.view.View; | |
/** | |
* Created by Ishaq Hassan | |
*/ | |
public class Message { | |
int id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun MyClass.hello(){ | |
} | |
fun main(args: Array<String>) { | |
val myObj = MyClass("Ishaq",10,"34343434") | |
myObj.phone | |
myObj.hello() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compileKotlin2Js.kotlinOptions { | |
moduleKind = "commonjs" | |
outputFile = "functions/index.js" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd functions && npm install kotlin --save && cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
external fun require(module:String) : dynamic | |
external var exports: dynamic | |
fun main(args: Array<String>) { | |
val fireFunctions = require("firebase-functions") | |
exports.myTestFun = fireFunctions.https.onRequest { request , response -> | |
response.send("Hi from kotlin!") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ishaquehassan.recyclerviewgeneraladapter | |
import android.support.v7.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
class RecyclerGeneralTypeAdapter<T>(val data:ArrayList<T>, private val layoutFiles:Map<Int,Int>, val onGetViewType:(Int, T)->Int, val onBindItem:(itemData:T, viewHolder:RecyclerGeneralTypeAdapter<T>.RecyclerGeneralViewHolder)->Unit) : RecyclerView.Adapter<RecyclerGeneralTypeAdapter<T>.RecyclerGeneralViewHolder>(){ | |
constructor(data:ArrayList<T>,layoutFile: Int,onBindItem:(T,RecyclerGeneralTypeAdapter<T>.RecyclerGeneralViewHolder)->Unit):this(data, mapOf(-10 to layoutFile),{_,_->-10},onBindItem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import androidx.annotation.NonNull; | |
import androidx.recyclerview.widget.RecyclerView; | |
import java.util.ArrayList; | |
import java.util.Map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyThreadsApp { | |
public static void main (String [] args) | |
{ | |
Thread currentThread = Thread.currentThread(); | |
System.out.println(currentThread); | |
MyThread mt1 = new MyThread (); | |
mt1.setName("MyThread1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:http/http.dart' as http; | |
class Api{ | |
static final String BASE_URL = "http://yourserver.com"; | |
static final String API_KEY = "YOUR_KEY"; | |
static String fcmTOKEN = "YOUR_TOKEN"; | |
Future<http.Response> getRequest(String endPoint){ | |
return http.get(BASE_URL+"/"+endPoint, headers: { | |
"apikey": API_KEY |
OlderNewer