Skip to content

Instantly share code, notes, and snippets.

View marufmax's full-sized avatar
🎯
Focusing

Maruf Alom marufmax

🎯
Focusing
View GitHub Profile
@marufmax
marufmax / PhpUbuntuOracle.sh
Created June 26, 2018 09:45
PHP Ubuntu and Oracle
sudo ln -s /opt/oracle/instantclient_12_1/sqlplus /usr/bin/sqlplus
sudo ln -s /opt/oracle/instantclient_12_1 /opt/oracle/instantclient
sudo ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient/libclntsh.so
sudo ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient/libocci.so
sudo apt install -y php7.1-fpm php7.1-curl php7.1-gd php7.1-mcrypt php7.1-mbstring php7.1-gettext php7.1-token-stream php7.1-zip
export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client/lib/:$LD_LIBRARY_PATH
@marufmax
marufmax / nginx-tuning.md
Created June 26, 2018 09:45 — forked from luuminhthai/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@marufmax
marufmax / v-cloak.md
Created July 23, 2018 09:17 — forked from adamwathan/v-cloak.md
Useful CSS utilities for Vue.js cloaking

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@marufmax
marufmax / query.php
Last active July 26, 2018 03:40
Eloquent with raw sql and eqlouent where join select
<?php
//Raw SQL
$present = DB::select(DB::raw("SELECT count(had.emp_id) as present FROM hta_emp_personal hep
INNER JOIN hta_attendance_details had ON hep.emp_id=had.emp_id
AND had.att_date='2018-07-07 00:00:00'
AND had.status='P'"));
// ORM
@marufmax
marufmax / migration.sql
Last active September 22, 2018 05:41
Laravel package Entrust Migration in SQL
-- Creating Roles Table
-- Create table for storing roles
create table roles ( id number(10,0) not null, name varchar2(255)
not null, display_name varchar2(255) null, description varchar2(255) null, created_at timestamp null, updated_at timestamp null,
constraint roles_id_pk primary key ( id ) )
alter table roles add constraint roles_name_uk unique ( name )
create sequence roles_id_seq start with 1
create trigger roles_id_trg
@marufmax
marufmax / README.md
Created October 18, 2018 04:46 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@marufmax
marufmax / App\Exceptions\Handler.php
Last active December 17, 2018 10:15
Laravel/Lumen API Error Handleing
<?php
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
@marufmax
marufmax / 00_readme.md
Last active January 15, 2019 05:24
Optimizing Wordpress Site

This is a file repo for a blog post

visit

@marufmax
marufmax / bitbucket-pipelines.yml
Created January 17, 2019 11:44 — forked from mcnamee/bitbucket-pipelines.yml
Bitbucket Pipelines - Deploy via FTP to shared hosting
# Installation ---
# 1. In Bitbucket, add $FTP_USERNAME $FTP_PASSWORD and $FTP_HOST as environment variables.
# 2. Commit this file to your repo
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will
# push everything and initial GitFTP)
#
# Usage ---
# - On each commit to master branch, it'll push all files to the $FTP_HOST
# - You also have the option to 'init' (from Bitbucket Cloud) - pushes everything and initialises
# - Finally you can also 'deploy-all' (from Bitbucket Cloud) - if multiple deploys fail, you
@marufmax
marufmax / ~\.ssh\config
Created April 11, 2019 11:49
SSH Bitbucket and Deployment User
Host *
IgnoreUnknown AddKeysToAgent,UseKeychain
UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa_bitbucket