Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Muhammad Sumon Molla Selim SumonMSelim

🎯
Focusing
View GitHub Profile
@SumonMSelim
SumonMSelim / hasin_puzzle_01.php
Last active Aug 29, 2015
Getting value from repeatable input block
View hasin_puzzle_01.php
<?php
$array = [];
foreach ($_POST['name'] as $key => $value) {
$array[$key]['name'] = $value;
$array[$key]['email'] = $_POST['email'][$key];
}
var_dump($array);
@SumonMSelim
SumonMSelim / .zshrc
Created Apr 20, 2016
My ZSH Configuration on MAC OSX with Powerline
View .zshrc
# Path to your oh-my-zsh installation.
export ZSH=/Users/sumonselim/.oh-my-zsh
# Set name of the theme to load.
ZSH_THEME="powerlevel9k/powerlevel9k"
# powerlevel9k customizations
POWERLEVEL9K_MODE='awesome-patched'
POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
@SumonMSelim
SumonMSelim / install_mysql.sh
Created May 12, 2016 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
View install_mysql.sh
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
@SumonMSelim
SumonMSelim / install.sh
Last active Dec 12, 2019
Install PHP 7, MySQL and nginx
View install.sh
# install necessary softwares & update dependencies
sudo apt-get update
sudo apt-get install -y software-properties-common curl git
sudo apt-get dist-upgrade
# install php 7.2
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
@SumonMSelim
SumonMSelim / nginx-cache
Created Oct 24, 2016
nginx fastcgi cache
View nginx-cache
### SET THESE OUTSIDE `server` BLOCK ###
# set cache path, key and expiration time
fastcgi_cache_path /tmp/cache levels=1:2 keys_zone=MYAPP:512m inactive=60m;
# handle nginx crash, timeout, error responses and serve cached data
fastcgi_cache_use_stale error timeout invalid_header http_500;
# ignore cache headers
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
@SumonMSelim
SumonMSelim / symfony.sh
Created Dec 19, 2018
Bootstrapping A Symfony Project
View symfony.sh
# PHP annotations support for route 🚀
composer require annotations
# Symfony maker bundle added for quick development 📦
composer require symfony/maker-bundle --dev
# For database
composer require symfony/orm-pack
# Security 👮
@SumonMSelim
SumonMSelim / .zshrc
Created May 9, 2019
My Terminal Configuration (oh-my-zsh+iTerm2)
View .zshrc
# Path to your oh-my-zsh installation.
export ZSH=/Users/SumonMSelim/.oh-my-zsh
# Set name of the theme to load.
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE="awesome-fontconfig"
# User configuration
export TERM="xterm-256color"
export SHELL="/bin/zsh"
@SumonMSelim
SumonMSelim / jira.sh
Last active Jul 7, 2019
Jira on Ubuntu 18.04
View jira.sh
wget https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-software-8.2.2-x64.bin
chmod a+x atlassian-jira-software-8.2.2-x64.bin
sudo ./atlassian-jira-software-8.2.2-x64.bin
# letencrypt ssl
sudo certbot certonly --standalone -d jira.kodeeo.com
# add JAVA_HOME to /etc/environment
JAVA_HOME="/opt/atlassian/jira/jre/bin"
@SumonMSelim
SumonMSelim / append.php
Created Jul 8, 2019
php append to file
View append.php
<?php
$tag_to_add = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
$file = 'file.xml';
// Using file_put_contents()
$myfile = file_put_contents($file, $tag_to_add.PHP_EOL , FILE_APPEND | LOCK_EX);
// Using fwrite()
$fstream = fopen($file, 'a');
fwrite($fstream, '\n'. $tag_to_add);