Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Maruf Alom marufmax

🎯
Focusing
View GitHub Profile
@marufmax
marufmax / Dockerfile
Created Jun 9, 2021
PHP 8 with Imagick Dockerfile
View Dockerfile
## This is a very basic PHP 8 Dockerfile with Imagick installed from source
## Modify/Customize this file as per your need
FROM php:8.0-fpm
RUN apt-get update && \
apt-get install openssl -y && \
apt-get install libssl-dev -y && \
apt-get install wget -y && \
apt-get install git -y && \
View docker-commands.md

Docker Commands

Some docker commands I found useful on internet. Instead of searching them everytime this is where I do keep track of them 🎉

Remove and Kill all running containers

docker stop $(docker ps -a -q)
@marufmax
marufmax / ImageUpload.vue
Created Nov 3, 2019
Simple VueJS Multiple Image Upload
View ImageUpload.vue
<template>
<div>
<ul class="el-upload-list el-upload-list--picture-card">
<li
v-for="image in images"
tabindex="0"
class="el-upload-list__item is-ready"
>
<div>
<img
@marufmax
marufmax / ~\.ssh\config
Created Apr 11, 2019
SSH Bitbucket and Deployment User
View ~\.ssh\config
Host *
IgnoreUnknown AddKeysToAgent,UseKeychain
UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa_bitbucket
@marufmax
marufmax / bitbucket-pipelines.yml
Created Jan 17, 2019 — forked from mcnamee/bitbucket-pipelines.yml
Bitbucket Pipelines - Deploy via FTP to shared hosting
View bitbucket-pipelines.yml
# 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 / 00_readme.md
Last active Jan 15, 2019
Optimizing Wordpress Site
View 00_readme.md

This is a file repo for a blog post

visit

@marufmax
marufmax / App\Exceptions\Handler.php
Last active Dec 17, 2018
Laravel/Lumen API Error Handleing
View App\Exceptions\Handler.php
<?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 / README.md
Created Oct 18, 2018 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods
View README.md

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@marufmax
marufmax / migration.sql
Last active Sep 22, 2018
Laravel package Entrust Migration in SQL
View migration.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 / query.php
Last active Jul 26, 2018
Eloquent with raw sql and eqlouent where join select
View query.php
<?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