Skip to content

Instantly share code, notes, and snippets.

View ishaquehassan's full-sized avatar
🎯
I may be slow to respond.

Ishaq Hassan ishaquehassan

🎯
I may be slow to respond.
View GitHub Profile
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!")
}
}
cd functions && npm install kotlin --save && cd ..
compileKotlin2Js.kotlinOptions {
moduleKind = "commonjs"
outputFile = "functions/index.js"
}
fun MyClass.hello(){
}
fun main(args: Array<String>) {
val myObj = MyClass("Ishaq",10,"34343434")
myObj.phone
myObj.hello()
@ishaquehassan
ishaquehassan / Message.java
Created August 15, 2017 15:24
A Simple chat messages model for Android Native using JAVA
package com.cyberavanza.chat.model;
import android.view.View;
/**
* Created by Ishaq Hassan
*/
public class Message {
int id;
@ishaquehassan
ishaquehassan / consoleWriteLine.java
Created March 27, 2017 15:57
A Simple Method to make System.out.println() works like C#'s Console.writeLine()
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);
}