Skip to content

Instantly share code, notes, and snippets.

View nahidacm's full-sized avatar

Mahmudur Rahman nahidacm

  • Dhaka, Bangladesh
View GitHub Profile
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@nahidacm
nahidacm / email-test.php
Created October 30, 2014 03:27
PHP Email Testing Script
<?php
if(isset($_POST['submit'])){
$to = $_POST['email_to']; // this is your Email address
$from = $_POST['email_from']; // this is the sender's Email address
$name = $_POST['name'];
$subject = "Form submission";
$subject2 = "Copy of your form submission";
$message = $name . " " . " wrote the following:" . "\n\n" . $_POST['message'];
$message2 = "Here is a copy of your message " . $name . "\n\n" . $_POST['message'];
##################################################################################################
############################### Virtualhost named: softanis-pm.com ###############################
##################################################################################################
server {
listen 80;
listen [::]:80;
root /var/www/softanis-pm.com/html;
# Add index.php to the list if you are using PHP
@nahidacm
nahidacm / turn-any-form-into-ajax.html
Created December 11, 2016 03:27
Just make some some changes on your form, mostly adding some classes. your form will be a ajax form.
<script>
$(function () {
initAjaxFormPosts();
});
function initAjaxFormPosts() {
if ($("form .form-actions.ajax-form").length > 0) {
$("form .form-actions.ajax-form").each(function () {
var $form = $(this).closest("form");
$form.find(".form-actions.ajax-form .btn.submit").bind('click', function () {
@nahidacm
nahidacm / magnto2-nginx-fix.conf
Last active May 27, 2018 23:29
Magento2 out of the box nginx config file has got some issues. This file has got the fixes. with comment text #The setup fix
## Example configuration:
# upstream fastcgi_backend {
# # use tcp connection
# # server 127.0.0.1:9000;
# # or socket
# server unix:/var/run/php5-fpm.sock;
# server unix:/var/run/php/php7.0-fpm.sock;
# }
# server {
# listen 80;
@nahidacm
nahidacm / magento2-nginx-server-block.conf
Last active April 17, 2019 03:21
Nginx server block configuration for magento 2
# Only one server block may have `upstream fastcgi_backend` block.
# So if you already defined that for some virtual host of your server do not ad that again for other hosts.
# In that case only `server` block is required.
upstream fastcgi_backend {
server unix:/run/php/php7.2-fpm.sock;
}
server {
listen 80;
listen [::]:80;
@nahidacm
nahidacm / test.loc.conf
Created June 10, 2019 06:05
Ngix block file for laravel virtual host
server {
listen 80;
listen [::]:80;
root /var/www/test.loc;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name test.loc;
@nahidacm
nahidacm / phpmyadmin.conf
Created June 14, 2019 16:22
phpmyadmin nginx server block
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
#!/bin/bash
if [ "$1" == "extra" ]; then
start_msg="Starting napa extra"
else
start_msg="Starting napa"
fi
echo $start_msg
# VCL version 5.0 is not supported so it should be 4.0 even though actually used Varnish version is 5
vcl 4.0;
import std;
# The minimal Varnish version is 5.0
# For SSL offloading, pass the following header in your proxy server or load balancer: 'X-Forwarded-Proto: https'
backend default {
.host = "127.0.0.1";
.port = "8080";