Skip to content

Instantly share code, notes, and snippets.

View mohamad-supangat's full-sized avatar
:shipit:
Working from home

Mohmad Supangat mohamad-supangat

:shipit:
Working from home
View GitHub Profile
@mohamad-supangat
mohamad-supangat / example.nginx
Created February 27, 2025 08:06 — forked from gsanders5/example.nginx
Automatic nginx virtual subdomains with sub-folders or sub-directories
# Automatic nginx virtual subdomains with sub-folders or sub-directories
#
# Since the original source where I found this code is now offline, I have decided to mirror it here.
# All credit goes to: http://web.archive.org/web/20150307193208/http://www.messaliberty.com/2010/10/automatic-nginx-virtual-subdomains-with-sub-folders-or-sub-directories
#
# Description: In my web root directory I wanted create a folder called photos, and another called
# music using a sftp program. Without manually going back to the config file or to the shell I like to
# be able to access them at photos.nginxdomain.com and music.nginxdomain.com. That is what this config does.
# Redirect visitors from http://nginxdomain.com/ to http://www.nginxdomain.com/

How to run laravel Schedule and Queue with Supervisor

Create supervisor config file for laravel

nano /etc/supervisor/conf.d/laravel-worker.conf

laravel-worker.conf

@mohamad-supangat
mohamad-supangat / _Notes.md
Created August 21, 2024 03:48 — forked from bassamsdata/_Notes.md
MiniFiles Git integration

Below is a code for Minifiles Git integration code snippet.

How to use it

Just insert the code below into this function in your Minifiles config:

config = function()
-- add the git code here
end
@mohamad-supangat
mohamad-supangat / .gitlab-ci.yml
Created May 6, 2024 06:26 — forked from amitavroy/.gitlab-ci.yml
Continuous Integration with Gitlab
stages:
- test
# Variables: these have to match
# the .env.example credentials in your Laravel app
# use the default homestead/secret combination, since
# that database gets created in the edbizarro/gitlab-ci-pipeline-php:7.1
# docker image.
variables:
MYSQL_ROOT_PASSWORD: root
@mohamad-supangat
mohamad-supangat / Transactional.php
Created September 13, 2023 03:35 — forked from aambrozkiewicz/Transactional.php
Laravel Middleware with Database transaction
<?php
namespace App\Http\Middleware;
use Closure;
class Transactional
{
public function handle($request, Closure $next)
{
@mohamad-supangat
mohamad-supangat / UDID
Created August 14, 2023 01:41 — forked from rvill/UDID
get iOS device UDID without xcode or itunes, using linux cmd line
lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2
@mohamad-supangat
mohamad-supangat / release
Created March 31, 2023 14:15 — forked from foca/release
Small shell script to create GitHub releases from the command line
#!/usr/bin/env bash
set -e
[ -z "$DEBUG" ] || set -x;
usage() {
echo "$0 <repo> <tag> [<release name>] [-- <asset>...]" >&2;
}
if [ "$1" = "-h" -o "$1" = "--help" ]; then
@mohamad-supangat
mohamad-supangat / add-frame.sh
Created March 21, 2023 04:59 — forked from stefanoschrs/add-frame.sh
deviceframe iPhone X hack
outputDir=/tmp/screenshots/framed
mkdir -p ${outputDir}
##########
# iPhone #
##########
padPath=/tmp/iphone-pad.png
convert -size 1125x185 xc:#e65562 ${padPath}
for filePath in $(find /tmp/screenshots/ | grep iPhone | grep -v framed) ; do
@mohamad-supangat
mohamad-supangat / github_release_script.sh
Created March 16, 2023 14:00 — forked from Jaskaranbir/github_release_script.sh
Shell script to create GitHub releases with automatically generated changelogs (using github-changelog-generator).
#!/bin/bash
# ===> Set these variables first
branch="$GIT_BRANCH"
# Example: "Jaskaranbir/MyRepo"
repo_slug="$TRAVIS_REPO_SLUG"
token="$GITHUB_TOKEN"
version="$TRAVIS_TAG"
# An automatic changelog generator
@mohamad-supangat
mohamad-supangat / sms-mailer.py
Created December 31, 2022 14:33 — forked from joneskoo/sms-mailer.py
Send unread SMS messages (from adb shell) to email
#!/usr/bin/env python3
# Joonas Kuorilehto 2013
# This script is Public Domain.
import csv
import subprocess
import pipes
from datetime import datetime
import smtplib