Skip to content

Instantly share code, notes, and snippets.

View shubhamoy's full-sized avatar
🎯
Focusing

Shubhamoy shubhamoy

🎯
Focusing
View GitHub Profile
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default but should be enabled
| whenever you intend to do a schema migration.
|
*/
@shubhamoy
shubhamoy / gist:a49e51340407ac78dd1a
Last active August 29, 2015 14:11
PHP Group: Code Correction
public function check($username)
{
static $rule=null;
if(is_null($rule))
{
$rule = [$username => 'unique:login'];
}
//$validation=Validator::make(array([$username=>$username]),$rule);
$validation=Validator::make(array(['username'=>$username]), $rule);
if($validation->passes())

Keybase proof

I hereby claim:

  • I am shubhamoy on github.
  • I am shubhamoy (https://keybase.io/shubhamoy) on keybase.
  • I have a public key whose fingerprint is 6808 9710 24EF E260 4CA4 9151 28FA EB92 E318 BAFA

To claim this, I am signing this object:

@shubhamoy
shubhamoy / docker-ps-vertical
Last active January 9, 2018 10:33 — forked from wzulfikar/docker-ps-vertical
vertical format for docker ps
export FORMAT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\n"
Usage: docker ps --format=$FORMAT
For persistence, we need to add this the shell configuration file. Like for OhMyZSH, we will do as follows:
echo 'export FORMAT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\n"' >> ~/.zshrc
source ~/.zshrc
@shubhamoy
shubhamoy / Dockerfile
Created January 21, 2018 10:01
Dockerfile for PHP Production
From alpine:3.4
MAINTAINER Shubhamoy - https://github.com/shubhamoy
# Timezone
ENV TIMEZONE Asia/Kolkata
ENV PHP_MEMORY_LIMIT 512M
ENV MAX_UPLOAD 50M
ENV PHP_MAX_FILE_UPLOAD 200
ENV PHP_MAX_POST 100M
ENV DUMB_INIT_VERSION 1.2.1
@shubhamoy
shubhamoy / docker-compose-dev.yml
Created January 21, 2018 10:09
docker-compose file for photolia development
version: '3'
services:
dbdev:
image: mysql:latest
networks:
- devnet
environment:
- MYSQL_ROOT_PASSWORD=toor
restart: always
volumes:
@shubhamoy
shubhamoy / cloudflare_only.sh
Created March 19, 2018 12:34 — forked from ninjatrench/cloudflare_only.sh
Script (For Linux Servers) to Prevent Real IP address Leak Protected Behind CloudFlare
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "[-] This script must be run as root [-]"
exit 1
fi
echo "[+] Reseting Initiated [+]"
ufw disable
echo "[?] Current Status [?]"
ufw status numbered verbose
@shubhamoy
shubhamoy / tmux.conf
Created July 17, 2024 06:33
My tmux config
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# set window split
bind-key v split-window -h
bind-key b split-window
# default window title colors