Skip to content

Instantly share code, notes, and snippets.

@mrcnkoba
mrcnkoba / talk.js
Last active October 23, 2018 09:41
var fetch = require('node-fetch');
var appId = "YOUR_APP_ID";
var secret = "YOUR_SECRET_KEY";
var userId = "3918" // replace with ID of the user from your own database.
var url = `https://api.talkjs.com/v1/${appId}/users/{userId}`;
var body = {
name: "John Doe"
email: ["john@doe.com"]
popup.createHtmlPanel({
url: YOUR_URL
height: 75
})
.then(function (htmlPanel) {
const onload = (reason) => {
console.log(htmlPanel.window.document.getElementById("register-form"));
};
// if it is still loading please add event listener to DOMContentLoaded
if(htmlPanel.window.readystate === "loading") {
TalkJS makes it simple to send iOS/Android Mobile Push Notifications. The moment you are set up and your users use TalkJS inside your Mobile app, TalkJS will send them notifications on every message, so that they don't miss anything. Here is what you need to get started:
1.
a. Copy the server key from Firebase dashboard and paste into the TalkJS dashboard.
b. Generate a production .p12 certificate for iOS push notifications in the Apple Developer Dashboard and upload it into the TalkJS dashboard.
2. Add your users' device tokens using TalkJS Javascript SDK.
Here is a short code example presenting how to add a device token using Cordova/Phone-gap push plugin:
```
import React from "react";
import ReactDOM from "react-dom";
(function(t,a,l,k,j,s){
s=a.createElement('script');s.async=1;s.src="https://cdn.talkjs.com/talk.js";a.getElementsByTagName('head')[0].appendChild(s);
t.Talk={ready:{then:function(c){if(l)return new l(function(r,e){k.push([c,r,e]);});k.push([c]);},catch:function(){return l&&new l();},c:k}};
})(window,document,Promise,[]);
export default class Example extends React.Component {
constructor(props) {
import React from "react";
import ReactDOM from "react-dom";
export default class Example extends React.Component {
_appendScript(source) {
const script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", source);
document.body.appendChild(script);
}
function *fizzbuzz() {
yield '1';
yield '2';
yield 'fizz';
yield '4';
yield 'buzz';
yield 'fizz';
yield '7';
yield '8';
yield 'fizz';
defmodule StringsAndBinaries do
def anagram?(word1, word2) do
sortedWithoutSpaces1 = Enum.sort(word1) |> Enum.reject(fn(x) -> x === ' ' end)
sortedWithoutSpaces2 = Enum.sort(word2) |> Enum.reject(fn(x) -> x === ' ' end)
_anagram?(sortedWithoutSpaces1, sortedWithoutSpaces2, true)
end
defp _anagram?([], [], value), do: value
defp _anagram?(_, [], value), do: false
defp _anagram?([], _, value), do: false
public interface ITask
{
void Execute();
}
public class SimpleTask : ITask
{
public void Execute()
{
Console.WriteLine("X");
using System;
using System.Data;
using System.Linq;
using Dapper;
using IzoobleBackend.MainDomain.DB;
using IzoobleBackend.MainDomain.Dtos;
namespace IzoobleBackend.MainDomain.Queries
{
public class GetGlobalStreamQuery : IQuery<StreamDto>
module Model {
declare var window:Window;
export class Stream {
public reviews: Review[];
public proxy: Proxy;
public constructor(proxy: Proxy) {
this.reviews = new Array<Review>();
this.proxy = proxy;
}