Skip to content

Instantly share code, notes, and snippets.

Side project

Ariful Haque arifulhb

Side project
View GitHub Profile
arifulhb / getTotalSearchNum
Created December 29, 2014 09:14
Get total number of records based on keyword and search_by item.
View getTotalSearchNum
public function getTotalSearchNum($keyword, $search_by){
$sql='SELECT cust_sn ';
$sql.='FROM (avcd_customer AS c) ';
switch ($search_by):
case 'name':
$sql.='WHERE c.cust_first_name LIKE "%'.$keyword.'%" OR c.cust_last_name LIKE"%'.$keyword.'%" ';
arifulhb / getTotalNum
Created December 29, 2014 09:19
Get Total Row Numbers
View getTotalNum
public function getTotalNum(){
return $res->num_rows;
}//end function
arifulhb / .htaccess
Created January 19, 2015 10:35
A simple .htaccess for CodeIgniter
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
Options -Indexes
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
arifulhb / .htaccess
Created January 22, 2015 07:21
CodeIgniter .htaccess for folder
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
Options -Indexes
RewriteBase /foldername/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /foldername/index.php/$1 [L]
AddOutputFilter DEFLATE css js
ExpiresActive On
arifulhb / unixtimestamptojavascriptdate
Created March 4, 2015 07:38
unix timestamp to javascript date
View unixtimestamptojavascriptdate
var ep = '1424901599';
var date = new Date(ep*1000);
var iso = date.toLocaleString();
View javascript-response-object
'use strict';
module.exports = function () {
return {
created: function (obj, message) {
return {
status: true,
httpStatus: 201,
message: message,
arifulhb / .vimrc
Created July 24, 2016 09:43 — forked from JeffreyWay/.vimrc
Laracasts: Vim Mastery - Episode 3 .vimrc progress
View .vimrc
syntax enable
colorscheme desert
"-------------General Settings--------------"
set backspace=indent,eol,start "Make backspace behave like every other editor.
let mapleader = ',' "The default leader is \, but a comma is much better.
set number "Let's activate line numbers.
View Block Baidu Spider via robots.txt
# Block Baidu spider
User-agent: Baiduspider
User-agent: baiduspider
User-agent: Baiduspider-video
User-agent: Baiduspider-image
User-agent: Baiduspider+
Disallow: /
# BLOCK Yandex
User-agent: Yandex
View Block Google Analytics Spam via .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# block google analytics spam
arifulhb / ecuador.json
Created May 6, 2018 06:02
Ecuador Province and Cantons list.
View ecuador.json
"Province SN": 1,
"Province": "Azuay",
"cantons": [
"Canton": "Camilo Ponce Enríquez",
"Capital": "Camilo Ponce Enríquez"