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 / .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
@mohamad-supangat
mohamad-supangat / laravel-subdirectory.conf
Created December 3, 2022 01:25 — forked from tsolar/laravel-subdirectory.conf
Laravel in subdirectory nginx example
server {
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 300M;
sendfile on;
send_timeout 300s;
# Port that the web server will listen on.
#listen 80;
@mohamad-supangat
mohamad-supangat / icheck.sh
Created October 12, 2022 03:28 — forked from bcantoni/icheck.sh
Bash script for checking internet connection status and keeping a local log when it changes. Meant to be run at some regular interval as a cron job.
#!/bin/bash
# check internet connectivity status
# file 'status' contains last known status (online or offline)
# file 'status.log' has an entry every time status changes
source ./status
echo "last status: $status at $time"
if nc -zw1 google.com 443; then
echo "online"
if [[ "$status" = "online" ]]; then
@mohamad-supangat
mohamad-supangat / script.sh
Created October 11, 2022 07:04 — forked from silvae86/script.sh
Flashing a boot.img (Kernel, for example) in an Android mobile phone via adb shell
#Tested with Samsung Galaxy Note 3 (your mobile phone may have different paths and partitions!!)
#check adb connection...
adb devices
#copy the boot.img image to the mobile phone (in this case, the root of the SD Card)
adb push <path_to_your_boot.img_extracted_from_custom_rom_zip>/boot.img /external_sd/boot.img
#open shell
adb shell