Skip to content

Instantly share code, notes, and snippets.

View mohsenk's full-sized avatar
🎯
Focusing

Mohsen Karimi mohsenk

🎯
Focusing
View GitHub Profile
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class App {
public static void main(String[] args) throws Exception {
@mohsenk
mohsenk / CallActivity.java
Created December 21, 2019 09:42
Homa App Call Activity
package mobi.homa.app.activities;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
(function(global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global.boka_widget = factory()
}
)(this, function() {
var publicCallback, container, wrapper, banner, iframe, overlay;
function public() {
publicCallback.apply(null, arguments)
}
var mode = {
none: 0,
self.kavenegarCall.initCall(params, (joinResult, call) => {
if (call == null) {
window.location.hash = "";
return;
}
if (call.direction === CallDirection.INBOUND) {
call.ringing();
}
this.setConversationUI();
KavenegarCall.getInstance().initCall(
callId, accessToken, this,
result => {
call.setMediaStateChangedEventHandler
(this::peerConnectionStateChanged);
call.setMessagingStateChangedHandler
(this::messagingSateChanged);
call.onCallStateChanged(state =>
{ Log.d("Call state is changed",state);});
call.onCallFinished(reason =>
public class ContactsAdapter extends ArrayAdapter<User> {
private Context context;
private List<User> contacts;
private Callback<User> onCall;
public ContactsAdapter(@NonNull Context context, List<User> list, Callback<User> onCall) {
super(context, 0, list);
this.context = context;

Landing Page Porposal

Features

  • Ability to select diffrent templates
  • Ability to fill and change template variables ( like images and texts)
  • Ability to enable or disable any section or part of template
  • We can define templates that use handlebars syntax and save it to db or file system
  • Every template contains a config.json file and contains template configuration
  • A Template is consis of components and every component has props
## Configuration file
```json
{
"name" : "Default Template",
"description" : "A simple template contains heading and gallery and staff and contact",
"components" : [
{
"name" : "toolbar",
curl 'https://bookbook-dev.appspot.com/Org/6230320227549184/User/4M2Ko7E1A7be1BT6C1sLMojlMzC2/Details' -H 'Accept: application/json' -H 'Referer: http://localhost:3000/' -H 'Origin: http://localhost:3000' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36' -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImEzMjJiNjhiY2U0MzExZTg2OTYzOTUzM2QzYTFhMjU1MWQ1ZTc0YzYifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vYm9va2Jvb2stZGV2IiwiYXVkIjoiYm9va2Jvb2stZGV2IiwiYXV0aF90aW1lIjoxNTM3OTAzNzI3LCJ1c2VyX2lkIjoiNE0yS283RTFBN2JlMUJUNkMxc0xNb2psTXpDMiIsInN1YiI6IjRNMktvN0UxQTdiZTFCVDZDMXNMTW9qbE16QzIiLCJpYXQiOjE1Mzc5MDM3MjcsImV4cCI6MTUzNzkwNzMyNywiZW1haWwiOiJtb2hzZW5AY29uaWMudGVjaCIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJmaXJlYmFzZSI6eyJpZGVudGl0aWVzIjp7ImVtYWlsIjpbIm1vaHNlbkBjb25pYy50ZWNoIl19LCJzaWduX2luX3Byb3ZpZGVyIjoicGFzc3dvcmQifX0.P7wY_nDRq88gRkqsLnauGSN2bneYF2rY1vK54EeH_5DEjyacL2D_oX_MKSxbjdalCczuiI9z66x5cwA_iBg6wwPsRf_fduXKG_Pj9CY
@mohsenk
mohsenk / ipsec.conf
Last active September 21, 2018 14:03
version 2.0
config setup
nat_traversal=yes
virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12,%v4:!192.168.42.0/23
protostack=netkey
nhelpers=0
interfaces=%defaultroute
uniqueids=no