Skip to content

Instantly share code, notes, and snippets.

View Ramesh-X's full-sized avatar
🏖️

Ramesh Pramuditha Rathnayake Ramesh-X

🏖️
View GitHub Profile
@Ramesh-X
Ramesh-X / .htaccess
Created January 10, 2019 06:00 — forked from vielhuber/.htaccess
Apache: htaccess force www and https ssl #server
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
@Ramesh-X
Ramesh-X / main.dart
Created June 29, 2020 12:20
FCM Flutter, Navigate on Notification Click
import 'package:bloc/bloc.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
// Start the App
void main() => runApp(MainApp());
@Ramesh-X
Ramesh-X / index.ts
Created December 15, 2020 09:42
custom-token-backend
const functions = require('firebase-functions');
const express = require('express');
const cors = require('cors');
const admin = require('firebase-admin');
import {Request, Response} from 'express';
if (admin.apps.length === 0) admin.initializeApp();
const mockAuth = async (id: String, passcode: String): Promise<boolean> => {
await new Promise(resolve => setTimeout(resolve, 1000));