Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mohamed Fouad MohammedFouad

🎯
Focusing
  • Freelancer
  • Egypt
View GitHub Profile
@MohammedFouad
MohammedFouad / database.rules.json
Created Jun 24, 2019 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
View database.rules.json
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@MohammedFouad
MohammedFouad / index.js
Last active Sep 19, 2019
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
View index.js
'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) => {
View android_material_design_colours.xml
<?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 Oct 21, 2017 — 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.
View CountDownTimer.java
/*
* 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