Skip to content

Instantly share code, notes, and snippets.

View kemalekren's full-sized avatar
👨‍💻
Coding

Esat Kemal Ekren kemalekren

👨‍💻
Coding
View GitHub Profile
import UIKit
final class HomeScene: UIViewController {
var collectionView: UICollectionView!
var dataSource: UICollectionViewDiffableDataSource<HomePresentation, HomeSection>?
var vm: HomeVMProtocol! {
didSet {
vm.delegate = self
@IBAction func billTextFieldAction(_ sender: Any) {
let tip = Double(tipTextField.text ?? "") ?? 0
let bill = Double(billTextField.text ?? "") ?? 0
calculateTip(tipAmount: tip, billAmount: bill)
}
exports.sendMail = functions.database.ref('/Reports/{uid}').onCreate((snapshot, context) => {
const val = snapshot.val();
// getting dest email by query string
const mailOptions = {
from: 'Sample Report <report@sample.com>', // You can write any mail Adress you want this doesn't effect anything
to: 'another@sample.com', // This mail adress should be filled with any mail you want to read it
tile: val.title,
admin.initializeApp();
let transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'yourGmailAdress',
pass: 'yourGmailPassword'
}
});
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const nodemailer = require('nodemailer');
const cors = require('cors')({ origin: true });
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const nodemailer = require('nodemailer');
const cors = require('cors')({ origin: true });
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const nodemailer = require('nodemailer');
const cors = require('cors')({ origin: true });
npm install -g firebase-tools
tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellId)
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow()
window?.makeKeyAndVisible()
let rootControoler = ViewController()
window?.rootViewController = rootControoler
return true
}