Skip to content

Instantly share code, notes, and snippets.

View talas9's full-sized avatar

Mohammed Talas talas9

View GitHub Profile
@talas9
talas9 / Instructions.sh
Last active August 9, 2018 11:12 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@talas9
talas9 / firestoreHelper.class.php
Last active July 3, 2018 21:24
Firestore helper class, limits batches to 500 and extends the original class
<?php
/**
* This class will help you automatically batch operations to firestore and when batch is committed,
* it will be split into sub-batches to obey the limit set by google firestore library
*
* USAGE:
*
* 1- Instantiate the class -> $f = new Firestore(['yourProjectId', './path/to/serviceAccountFile.json']);
*
@talas9
talas9 / firestoreHelper.class.php
Created July 3, 2018 20:52
Firestore helper class
<?php
use Google\Cloud\Firestore\FirestoreClient;
class Firestore extends FirestoreClient
{
public $batch = [];
public $count = [0 => 0];
private $pointer = 0;
private $FS_PATH;