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
'use strict' | |
const app = require('express')(), | |
request = require('request'), | |
mongo = require('mongodb'), | |
bodyParser = require('body-parser') | |
app.use(bodyParser.json()) | |
app.use(bodyParser.urlencoded({ | |
extended: false |
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
<manifest> | |
<application> | |
. . . | |
<meta-data android:name="android.webkit.WebView.EnableSafeBrowsing" | |
android:value="true" /> | |
. . . | |
</application> | |
</manifest> |
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
RelativeLayout layout = (RelativeLayout) findViewById(R.id.rel); | |
GradientDrawable drawable = new GradientDrawable(); | |
drawable.setColors(new int[] { | |
Color.parseColor("#FFF6B7"), | |
Color.parseColor("#F6416C") | |
}); | |
drawable.setGradientType(GradientDrawable.LINEAR_GRADIENT); | |
drawable.setOrientation(GradientDrawable.Orientation.LEFT_RIGHT); |
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
var express = require('express'); | |
var app = express(); | |
var fs = require('fs'); |
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
var app = angular.module('home', []); | |
app.directive('richcard', ['$sce', '$filter', function ($sce, $filter) { | |
return { | |
restrict: 'EA', | |
link: function (scope, element) { | |
scope.$watch('ld', function (val) { | |
var val = $sce.trustAsHtml($filter('json')(val)); | |
element[0].outerHTML = '<script type="application/ld+json">'+ val + '</script>' | |
}); |
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.mynotificationsapp.android; | |
import com.google.firebase.iid.FirebaseInstanceId; | |
import com.google.firebase.iid.FirebaseInstanceIdService; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.URL; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.mynotificationsapp.android"> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Notification Center</title> | |
<style> | |
body { | |
text-align: center; | |
} | |
h1 { |
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
app.post('/notify', (req, res) => { | |
let msg = req.body.message, | |
title = req.body.title, | |
type = req.body.type, | |
topic = req.body.topic | |
if (type === 'topic') { | |
sendToTopics(msg, title, topic, res) | |
} else { |
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
const sendToAll = (msg, title, regIdArray, response) => { | |
const data = { | |
"data": { | |
"body": msg, | |
"title": title | |
} | |
} | |
const folds = regIdArray.length % 1000 |
NewerOlder