Skip to content

Instantly share code, notes, and snippets.

View sanjay1688's full-sized avatar

Sanjay Sahu sanjay1688

View GitHub Profile
<?php
namespace App\Subscription;
use App\Entity\Subscription\IAPAndroidReceipt;
use App\Exception\InvalidAndroidReceiptException;
use App\Exception\InvalidArgumentsException;
use App\Exception\ReceiptNotFoundException;
use Carbon\Carbon;
use Doctrine\Common\Persistence\ManagerRegistry;
@bradtraversy
bradtraversy / pipenv_cheat_sheet.md
Last active July 7, 2024 20:34
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@Fed0t
Fed0t / GoogleInAppBillingController.php
Created November 21, 2018 11:16
GoogleInAppBillingController php example
<?php
namespace App\Http\Controllers;
use App\AdminActivityLog;
use App\Exceptions\ValidationException;
use App\GooglePayment;
use App\GooglePaymentRenew;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
@anapsix
anapsix / kinesis_consumer.php
Created December 15, 2017 17:08
Kinesis Consumer in PHP with AWS SDK
<?php
// if running in Alpine, install the following
// apk -U add php7 php7-mbstring php7-simplexml php7-json php7-phar php7-openssl curl
// curl -sS https://getcomposer.org/installer | php
// php composer.phar require aws/aws-sdk-php
//
// export AWS_ACCESS_KEY_ID=...
// export AWS_SECRET_ACCESS_KEY=...
if (getenv('KINESIS_STREAM')) {
$streamName = getenv('KINESIS_STREAM');
@boomhq
boomhq / .README
Last active June 21, 2018 10:51
Laravel-monogb ReplicaSet Atlas
1 a new laravel install
2 install: composer require jenssegers/mongodb
3 Add in config/app.php to the next of Service ¨Provider list :
Jenssegers\Mongodb\MongodbServiceProvider::class,
4 In config/database.php add the mongodb connexion
5 Add in .env new config :
6(option) Replace the User Models in app/User.php for use the auth ou of the box.
@jamalnasir
jamalnasir / rubymine.txt
Created April 5, 2017 12:24
Rubymine Activation
Version: 2016.3.2
Select License server and paste the following
http://idea.imsxm.com/
@Ravaelles
Ravaelles / Ubuntu server setup script (PHP 5.6)
Last active April 6, 2020 12:13
PHP 5.6 + nginx + MongoDB driver for PHP
#!/bin/bash
######################################################
### README ###########################################
######################################################
###
### One-line server install script for Ubuntu.
### Installs Nginx + PHP5.6 + MongoDB for PHP driver.
###
### Removes previous Apache, PHP, nginx installations.
@eladnava
eladnava / mongodb-s3-backup.sh
Last active March 11, 2024 10:21
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
######## Installing MongoDB ##############
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
service mongod start
service mongod status
@fbrnc
fbrnc / consumer.php
Last active February 13, 2023 11:25
AWS Kinesis Example for PHP (using the AWS SDK for PHP)
<?php
// curl -sS https://getcomposer.org/installer | php
// php composer.phar require aws/aws-sdk-php
// export AWS_ACCESS_KEY_ID=...
// export AWS_SECRET_ACCESS_KEY=...
$streamName = '<INSERT_YOUR_STREAMNAME_HERE>';
$numberOfRecordsPerBatch = 10000;