Skip to content

Instantly share code, notes, and snippets.

View iamMonzurul's full-sized avatar

Monzurul Haque iamMonzurul

View GitHub Profile
@iamMonzurul
iamMonzurul / wordpress.vcl
Created June 3, 2018 21:56 — forked from matthewjackowski/wordpress.vcl
Varnish 4 VCL configuration for WordPress. Also allows purging
# A heavily customized VCL to support WordPress
# Some items of note:
# Supports https
# Supports admin cookies for wp-admin
# Caches everything
# Support for custom error html page
vcl 4.0;
import directors;
import std;
@iamMonzurul
iamMonzurul / js.md
Created August 25, 2017 15:25 — forked from nuhil/js.md
Javascript Handbook

Javascript Handbook

A hand crafted markdown document contains all major Javascript topics covered, taken from different sources. Brush Up your JS memory.

Comments


Single line comments start with //. For multi-line commands, you use /* ... */

// This is a single line comment
@iamMonzurul
iamMonzurul / vps-setup.sh
Created October 26, 2015 08:02 — forked from EmranAhmed/vps-setup.sh
Simple and Straightforward VPS ( ubuntu and debian ) setup :)
#!/bin/bash
# Upload vps-setup.sh file
# open terminal and change permission like: chmod +x ./setup.sh
# ./vps-setup.sh
# delete this file after setup :)
COLOR_RESET="\033[33;0m"
COLOR_RED="\033[33;31m"
COLOR_GREEN="\033[33;32m"
@iamMonzurul
iamMonzurul / envato-screenshots-downloader.php
Created October 19, 2015 05:56 — forked from hasinhayder/envato-screenshots-downloader.php
Download large preview images from the envato item's screenshots page
#!/usr/bin/env php
<?php
//usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page
set_time_limit(0);
$dir = $argv[1];
$source = $argv[2];
print_r($argv);
mkdir ($dir);
$src = file_get_contents($source);
$pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i';

Redirect: Temporary and Permanent

Source

What is an HTTP Redirect?

HTTP redirection, or URL redirection, is a technique of pointing one domain or address to another. There are many uses for redirection, and a few different kinds of redirection to consider.

As you create content and administrate servers, you will often find the need to redirect traffic from one place to another. This guide will discuss the different use-cases for these techniques, and how to accomplish them in Apache and Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

server {
listen 80;
server_name www.example.com;
root /var/www/vhosts/example.com/public/;
location /
{
index index.php index.html index.htm;
}
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
//
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
//
// You may use it in your theme if you credit me.
// It is also free to use on any individual website.
//
// Exception:
// The only restriction would be not to publish any
// extension for browsers or native application
@iamMonzurul
iamMonzurul / generate-font-awesome-icons-array.php
Last active August 29, 2015 14:16
This script can generate font awesome icons array format for wordpress themes and plugin
<?php
/**
* Generate Font Awesome Icons Array
* @author Monzurul Haque
* @author_uri https://github.com/farukham
**/
//FontAwesome (4.3.0) Icons array list
$icons = array(