Skip to content

Instantly share code, notes, and snippets.

View MohammedFouad's full-sized avatar
🎯
Focusing

Mohamed Fouad MohammedFouad

🎯
Focusing
  • Freelancer
  • Egypt
View GitHub Profile
@MohammedFouad
MohammedFouad / database.rules.json
Created June 24, 2019 13:00 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@MohammedFouad
MohammedFouad / index.js
Last active September 19, 2019 14:03
This code is for device to device firebase notifications, Thanks for TVAC Studio channel for great tutorial on youtube https://www.youtube.com/watch?v=Abh3r9hh5gw&list=PLGCjwl1RrtcRHjHyZAxm_Mq4qvtnundo0&index=4
'use strict'
// The Cloud Functions for Firebase SDK to create Cloud Functions and setup triggers.
const functions = require('firebase-functions');
// The Firebase Admin SDK to access the Firebase Realtime Database.
const admin = require('firebase-admin');
admin.initializeApp();
exports.sendNotification = functions.firestore.document('Users/{user_id}/Notifications/{notification_id}').onWrite ((change, context) => {
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@MohammedFouad
MohammedFouad / CountDownTimer.java
Created October 21, 2017 05:59 — forked from bverc/CountDownTimer.java
Drop-in alternative for the Android CountDownTimer class, but which you can cancel from within onTick. Modified to include pause and resume functionality.
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software