Skip to content

Instantly share code, notes, and snippets.

View tapasdatta's full-sized avatar

Tapas Datta tapasdatta

View GitHub Profile
@tapasdatta
tapasdatta / serverless.yml
Created August 21, 2021 09:54
serverless configuration with laravel bref + dynamodb cache
service: test-func
useDotenv: true
provider:
name: aws
region: us-east-1
runtime: provided.al2
stage: ${opt:stage, 'dev'}
environment:
APP_ENV: production
[
{
"upazila": "Amtali Upazila",
"district": "Barguna",
"division": "Barisal"
},
{
"upazila": "Bamna Upazila",
"district": "Barguna",
"division": "Barisal"
// Function to get the client ip address
function get_client_ip() {
$ipaddress = '';
if ($_SERVER['HTTP_CLIENT_IP'])
$ipaddress = $_SERVER['HTTP_CLIENT_IP'];
else if($_SERVER['HTTP_X_FORWARDED_FOR'])
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if($_SERVER['HTTP_X_FORWARDED'])
$ipaddress = $_SERVER['HTTP_X_FORWARDED'];
else if($_SERVER['HTTP_FORWARDED_FOR'])
@tapasdatta
tapasdatta / doublesided.php
Created May 9, 2014 21:57
PHP script that generates PDF file with some text
<?php
require('fpdf.php');
class DoubleSided_PDF extends FPDF
{
var $doubleSided; // layout like books?
var $outerMargin;
var $innerMargin;
var $xDelta; // if double-sided, difference between outer and inner