Skip to content

Instantly share code, notes, and snippets.

View kousherAlam's full-sized avatar
💭
I may be slow to respond..

Kousher alam kousherAlam

💭
I may be slow to respond..
View GitHub Profile
<?php
/*
* This function is reponsible for rest the database.
* take two parameter first is array for connection to the database
* It will like ["hostname","dbuser","dbpass","dbname"]
* Secound argument for the reset db file location.
* first establish the connection , and then tranclate all table,
* Then read the content form the database file,
* insert all db file content using multiquery
@kousherAlam
kousherAlam / .htaccess
Created March 31, 2017 10:00
CI: Simple .htaccess using mod_rewrite for CodeIgniter
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
@kousherAlam
kousherAlam / emailheader.php
Created March 11, 2017 08:43
simple mail header for send mail form localhost
$headers = ‘MIME-Version: 1.0′ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1′ . “\r\n”;
$headers .= ‘From: sender@sender.com’ . “\r\n”;
mail(“you@yourdomain.com”,”test subject”,”test body”,$headers);
@kousherAlam
kousherAlam / server.js
Last active September 9, 2023 13:43
This is a basic node js server, serve the web page,font ,image and video from public folder...
const http = require("http"),
fs = require("fs"),
path = require("path"),
log = console.log;
//this will response with file type with specifiq content and encode
function response(res, file, contentType, encode) {
if (file != "404") {
res.writeHead(200, { "Content-type": contentType });
if (encode) {