Skip to content

Instantly share code, notes, and snippets.

View Shipu's full-sized avatar
🎯
Focusing

Shipu Ahamed Shipu

🎯
Focusing
View GitHub Profile
/*************************************
******** Team : BUBT_HIDDEN **********
**************************************
*********** Shipu Ahamed *************
*************************************/
#include<algorithm>
#include<iostream>
#include<iterator>
#include<cassert>
@Shipu
Shipu / EvenLoop.php
Last active September 19, 2017 21:05
Even Loop Printing
<?php
$data = [1,2,3,4,5,6,7, 8];
echo "<div class='own-countersoul'>";
for($i = 0; $i < count($data); $i += 2) {
echo "<div class='item'>";
echo "<div class='single_item'>".$data[$i]."</div>";
@Shipu
Shipu / ArrayChunkDefination.php
Last active September 19, 2017 21:08
Dynamic Splits Array like as "array_chunk()"
<?php
$data = [10,2,32,41,21,18,17,6,59];
$arraySize = count($data);
$chunkSize = 2;
echo "<div class='own-countersoul'>";
for($i = 0; $i < $arraySize; ) {
@Shipu
Shipu / php-version-switcher.sh
Last active August 20, 2019 18:34
Switch php versions in ubuntu
echo "Enter the php version you want to Disable:"
read disabledVersion
echo "Enter the php version you want to Enable:"
read enabledVersion
sudo a2dismod php${disabledVersion}
sudo a2enmod php${enabledVersion}
sudo service apache2 restart
# or
sudo service nginx restart
@Shipu
Shipu / vue-timer.html
Created December 19, 2017 17:00
Counter Example in Vue.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Vue Timer</title>
</head>
<body>
<?php
$caseNo = 0;
foreach (range(1, 9) as $numberOne) {
$makeNumberOne = ($numberOne * 100) + 62;
foreach (range(1, 9) as $numberTwo) {
@Shipu
Shipu / startup.sh
Last active July 23, 2018 19:08
Ubuntu Startup (Test on 17.10)
#!/usr/bin/env bash
# nginx
# php 7.2 & php 5.6
# mysql 5.7
# postgresql 9.4
# phpmyadmin
# node js stable
# docker ( ce )
# go (stable)
# composer
@Shipu
Shipu / domain-wildcard-nginx.conf
Last active March 30, 2018 12:59
Automatic Virtual host
server {
listen 80;
listen [::]:80;
server_name ~^(www\.)?(?<sname>.+?)$;
root /var/www/html/$sname;
index index.php index.html index.htm;
location / {
@Shipu
Shipu / Laravel-Container.md
Created April 8, 2018 19:14
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

Accessing the Container

@Shipu
Shipu / installer
Last active May 4, 2018 10:59
laravel installer sample class
<?php
namespace Shipu\Installer;
use App;
use Config;
/**
* Class Installer
* @package App
*/