Skip to content

Instantly share code, notes, and snippets.

View mahedi2014's full-sized avatar
🙂

Mahedi Azad mahedi2014

🙂
View GitHub Profile
@mahedi2014
mahedi2014 / bangladesh-upazila-district-division.json
Created February 2, 2021 04:39
bangladesh-upazila-district-division
[
{
"upazila": "Amtali Upazila",
"district": "Barguna",
"division": "Barisal"
},
{
"upazila": "Bamna Upazila",
"district": "Barguna",
"division": "Barisal"
@mahedi2014
mahedi2014 / laravel_svn_commands.md
Created May 4, 2020 04:53
Dev command list (laravel, svn)

#Laravel commands

php artisan config:clear php artisan cache:clear php artisan view:clear php artisan route:clear

composer dump-autoload

php artisan serve

.middle-content {
text-align: center;
height: 100%;
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
display: -moz-box;
-moz-box-pack: center;
-moz-box-align: center;
display: -ms-flexbox;
@mahedi2014
mahedi2014 / How to run laravel artisan serve in host
Created November 25, 2019 11:46
How to run laravel artisan serve in host
#Command to start serve and continue in backend:
1. Open terminal and run: php artisan serve --host 192.168.78.10 --port 5000 &
2. To exit from terminal: exit
##Stop artisan server from backend
1. Go to project directory by (project is in linux server on "my_project" directory): cd ../var/www/my_project
2. To show running server process: ps -ef | grep "$PWD/server.php"
Result is as:
[root@mahedi my_project]# root 6817 6813 0 17:14 ? 00:00:00 /usr/bin/php -S 192.168.78.10:5000 /var/www/my_project/server.php
@mahedi2014
mahedi2014 / How to host laravel in a subfolder on shared host
Last active November 24, 2019 04:49
How to host laravel in a subfolder on shared host
Let project name is "my_project". So all project files is contain this folder "my_project" as a root directory.
##Process
1. Cut the .htaccess file from "public" folder (my_project\public\.htaccess) and past it into root directory (my_project\)
2. Rename the server.php file (my_project\server.php) in root directory to index.php (my_project\index.php)
3. Open helper.php file (my_project\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php)
Replace the line in laravel 6.0 at line 148 of function "asset"
return app('url')->asset($path, $secure); to return app('url')->asset('/public/'.$path, $secure);
##Previous code:
@mahedi2014
mahedi2014 / syntax-highlight.html
Created December 27, 2017 10:35
Syntax highlight with js library
1. Add this before </body>
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
2. Encapsulate your code block with <pre> tag and the "prettyprint" class
<pre class="prettyprint">
$(function() {
alert('I am using Prettify as Syntax Highlighter');
});
</pre>
@mahedi2014
mahedi2014 / mini_cost_spanning_tree
Last active December 27, 2017 10:18
Minimum cost spanning tree using prime's algorithm in C programming
#include<stdio.h>
int a,b,u,v,n,i,j,ne=1;
int visited[10]={0},min,mincost=0,cost[10][10];
void main()
{
printf("\n Enter the number of nodes:");
scanf("%d",&n);
printf("\n Enter the adjacency matrix:\n");
@mahedi2014
mahedi2014 / index.php
Created June 16, 2016 08:31
Facebook like notification reader with ajax
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
var num =1;
$(document).ready(function() {
setInterval(longPoll,8000);
});
@mahedi2014
mahedi2014 / number_convert.php
Created June 11, 2016 07:17
Convert bangla number to english and word
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
$unicodeNumber = $_GET['num'];
print_r( $unicodeNumber);
function convertToEnglishNumber($unicodeNumber){
@mahedi2014
mahedi2014 / bangla.php
Created June 9, 2016 08:18
Virtual bangla input in textarea for web
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi">
</script>
<script type="text/javascript">
// Load the Google Transliteration API
google.load("elements", "1", { packages: "transliteration" });