Skip to content

Instantly share code, notes, and snippets.

View mdsohelmia's full-sized avatar
🎯
Focusing

Sohel Mia mdsohelmia

🎯
Focusing
View GitHub Profile
@alexedwards
alexedwards / Makefile
Last active July 22, 2024 04:49
Boilerplate Makefile for Go projects
# Change these variables as necessary.
MAIN_PACKAGE_PATH := ./cmd/example
BINARY_NAME := example
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
@ignasbernotas
ignasbernotas / SetModelAttributes.php
Last active July 5, 2022 12:53
A super simple artisan command to generate setting model properties
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
class SetModelAttributes extends Command
{
#!/usr/bin/env bash
# set -euo pipefail
# IFS=$'\n\t'
function deploy() {
# zero downtime deployment nextjs without vercel
echo "Deploy starting..."
git pull
@mdsohelmia
mdsohelmia / GitCommitEmoji.md
Created December 14, 2020 10:06 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@Starraider
Starraider / vim_tips.md
Last active July 2, 2024 22:03
Tips & Tricks for Vim/NeoVim

Tips & Tricks for Vim/NeoVim

Keyboard Shortcuts

Be aware the following shortcuts are only working, if you have the plugins installed mentioned below.

In Command Mode:

:w              Save file

:w filename Save file under new filename

<?php
namespace App\Providers;
use App\Support\Utils\OctaModal;
use App\Support\Utils\OctaResponse;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\ServiceProvider;
use Inertia\Inertia;
@stancl
stancl / deploy.sh
Last active July 7, 2024 03:12
Deploy using GitHub actions and SSH to a VPS
#!/bin/sh
set -e
vendor/bin/phpunit
npm run prod
git add .
(git commit -m "Build frontend assets for deployment to production") || true
(git push) || true
@Andrey2G
Andrey2G / encoding.txt
Last active June 13, 2024 07:55
Video Encoding with multiple resolutions
ffmpeg -i "c:/videos/sample.mp4
-map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0
-c:v libx264 -crf 22 -c:a aac -ar 48000
-filter:v:0 scale=w=480:h=360 -maxrate:v:0 600k -b:a:0 64k
-filter:v:1 scale=w=640:h=480 -maxrate:v:1 900k -b:a:1 128k
-filter:v:2 scale=w=1280:h=720 -maxrate:v:2 900k -b:a:2 128k
-var_stream_map "v:0,a:0,name:360p v:1,a:1,name:480p v:2,a:2,name:720p"
-preset slow -hls_list_size 0 -threads 0 -f hls -hls_playlist_type event -hls_time 3
-hls_flags independent_segments -master_pl_name "name-pl.m3u8"
"c:/videos/encoded/name-%v.m3u8"
@mokhosh
mokhosh / laravel-deployment-vps.md
Last active December 29, 2023 20:20
Deploy Laravel to VPS (LEMP, Git, Mail, Redis, SSL, etc.)

A BETTER ALTERNATIVE

Use laravel-sheploy instead. It's more capabale and much eaiser to use.

Sign in and create git user

  • ssh root@IP
  • adduser git
  • usermod -aG sudo git

Set SSH keys

on local machine

@mdsohelmia
mdsohelmia / compat_l5.php
Created September 15, 2019 08:56 — forked from vluzrmos/compat_l5.php
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)