Skip to content

Instantly share code, notes, and snippets.

View mhrubel's full-sized avatar
🖥️
Programming

Mahamudul Hasan Rubel mhrubel

🖥️
Programming
View GitHub Profile
@mhrubel
mhrubel / hostname.conf
Created February 8, 2019 13:43 — forked from Bharat-B/hostname.conf
WHMCS nGINX rules for SSL / Non SSL
### NON SSL | STANDARD HTTP
server {
listen 80;
server_name domain.com;
root /path/to/whmcs;
index index.php index.html;
access_log /var/log/nginx/domain.com.log combined;
access_log /var/log/nginx/domain.com.bytes bytes;
error_log /var/log/nginx/domain.com.error.log error;
location / {
@mhrubel
mhrubel / update_billing_emails.php
Created February 8, 2019 13:48 — forked from Pierowheelz/update_billing_emails.php
Forces WHMCS to only send invoice related emails to the billing contact. This is done by temporarily updating the primary account's email address and contact info to that of the billing contact (ie. it's a hack). Add this to your .../includes/hooks/ folder.
<?php
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
use WHMCS\Database\Capsule;
/*
* Temporarily updates the primary account's email address to that of the
* company's Billing contact upon creation of a new invoice so that invoices
* are not sent to the primary account holder.
@mhrubel
mhrubel / no_admin_confirm.php
Created February 8, 2019 13:52 — forked from jclarke/no_admin_confirm.php
Disables the confirm password feature in the WHMCS admin area. Place in includes/hooks
<?php
add_hook('AdminLogin', 1, function($vars) {
$_SESSION["AuthConfirmationTimestamp"] = \Carbon\Carbon::now()->timestamp;
});
add_hook('AdminAreaHeadOutput', 1, function($vars) {
$_SESSION["AuthConfirmationTimestamp"] = \Carbon\Carbon::now()->timestamp;
return '
<script type="text/javascript">
$(document).ready(function(){
<?php
/**
* Display Client's Credit Balance in Client Area
*
* @author WHMCMS
* @link www.whmcms.com
* @since WHMCS v6.0.0+
*/
<?php
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
function sendTelegramMessage($pm) {
global $vars;
//$chat_id = (""); //Group
$chat_id = (""); //Channel
$tokenbot = ("");
@mhrubel
mhrubel / ambn.php
Created February 8, 2019 14:06 — forked from AminulBD/ambn.php
Bangla WordPress Number
<?php
/*
Plugin Name: Bangla Number For WordPress
Plugin URI: https://aminul.net/
Description: Translate all number to bangla.
Version: 1.0.0
Author: Aminul Islam
Author URI: https://aminul.net/
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@mhrubel
mhrubel / bd-geo-code.sql
Created February 8, 2019 14:06 — forked from AminulBD/bd-geo-code.sql
BD GEO Code SQL Database
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
SET NAMES utf8mb4;
DROP TABLE IF EXISTS `districts`;
CREATE TABLE `districts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@mhrubel
mhrubel / address.json
Created February 8, 2019 14:08 — forked from AminulBD/address.json
Bangladdesh divisions, districts and upazila list in php array and json
{
"Rajshahi": {
"Joypurhat": [
"Akkelpur",
"Joypurhat Sadar",
"Kalai",
"Khetlal",
"Panchbibi"
],
"Bogura": [
@mhrubel
mhrubel / banglaSpellOut.php
Created February 8, 2019 14:09 — forked from AminulBD/banglaSpellOut.php
Spell out money amount in bangla word.
<?php
/**
* Convert number to word in bangla
*
* @param int $number
* @param string $after
* @param string $before
* @return string
*/
function banglaSpellOut($number = 0, $after = '', $before = '')
@mhrubel
mhrubel / wp-increase-timeout.php
Created February 8, 2019 14:12 — forked from sudar/wp-increase-timeout.php
Increase the curl timeout in WordPress
<?php
Copied from http://fatlabmusic.com/blog/2009/08/12/how-to-fix-wp-http-error-name-lookup-timed-out/
//adjustments to wp-includes/http.php timeout values to workaround slow server responses
add_filter('http_request_args', 'bal_http_request_args', 100, 1);
function bal_http_request_args($r) //called on line 237
{
$r['timeout'] = 15;
return $r;
}