Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Shipu Ahamed Shipu

🎯
Focusing
View GitHub Profile
View 119 - Greedy Gift Givers
/*************************************
******** Team : BUBT_HIDDEN **********
**************************************
*********** Shipu Ahamed *************
*************************************/
#include<algorithm>
#include<iostream>
#include<iterator>
#include<cassert>
@Shipu
Shipu / EvenLoop.php
Last active Sep 19, 2017
Even Loop Printing
View EvenLoop.php
<?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 Sep 19, 2017
Dynamic Splits Array like as "array_chunk()"
View ArrayChunkDefination.php
<?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 Aug 20, 2019
Switch php versions in ubuntu
View php-version-switcher.sh
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 Dec 19, 2017
Counter Example in Vue.js
View vue-timer.html
<!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>
View FindTwoNumberFromHasinVai.php
<?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 Jul 23, 2018
Ubuntu Startup (Test on 17.10)
View startup.sh
#!/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 Mar 30, 2018
Automatic Virtual host
View domain-wildcard-nginx.conf
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 Apr 8, 2018
Laravel's Dependency Injection Container in Depth
View Laravel-Container.md

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
laravel installer sample class
View installer
<?php
namespace Shipu\Installer;
use App;
use Config;
/**
* Class Installer
* @package App
*/