Skip to content

Instantly share code, notes, and snippets.

View mrofi's full-sized avatar
🏠
work from home

Mokhamad Rofiudin mrofi

🏠
work from home
View GitHub Profile
@mrofi
mrofi / openfortivpn_in_mac_os.md
Created February 24, 2022 08:20
Run OpenFortiVPN in MacOS

This tutorial requires OpenFortiVPN

How to :

  1. install via brew :
brew install openfortivpn
  1. create a config file, example :
// Response Header
Header('Filename: filename.ext');
// html
<a href="path/to/file" download>Link</a>
// js
$('[download]').click(function(e) {
e.preventDefault();
@mrofi
mrofi / vue-snippet.html
Created May 10, 2020 09:07
Vue JS Snippet
<!-- Show Router Link -->
<li class="items-center text-gray-800 hover:text-gray-600"
v-for="route in this.$router.options.routes"
v-bind:key="route.path"
>
<router-link
class="text-xs uppercase py-3 font-bold block"
v-bind:to="route.path"
activeClass="text-orange-500 hover:text-orange-600"
v-bind:exact="route.path == '/'"
@mrofi
mrofi / Dockerfile
Last active October 22, 2019 10:55
Laravel Stack (php-fpm + nginx + mysql) on Docker
FROM php:7.2-fpm
# Set working directory
WORKDIR /var/www
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
mariadb-client \
libpng-dev \
@mrofi
mrofi / nginx.conf
Created November 13, 2018 02:28
OSX NGINX Config (Install via Homebrew)
user <user> staff;
worker_processes auto;
error_log /var/log/nginx/error.log debug;
events {
worker_connections 256;
}
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
body {
background: repeat url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/7QCIUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAGscAVoAAxslRxwCAAACAAAcAnQAV8KpIENoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbGQgLSBodHRwOi8vd3d3LnJlZGJ1YmJsZS5jb20vcGVvcGxlL0NoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAA
@mrofi
mrofi / shell.sh
Created July 25, 2018 00:16
change video ration 16:9 to 9:16
ffmpeg -i video169.mp4 -lavfi '[0:v]scale=iw:ih*16/9,crop=w=iw*9/16' video916.mp4
@mrofi
mrofi / mysql_backup.config
Last active February 20, 2023 13:41 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
[client]
user = "mysql_user"
password = "mysql_password"
host = "localhost"
@mrofi
mrofi / phantomjs
Created February 15, 2017 19:07 — forked from deviantony/phantomjs
Installer script to setup phantomjs 1.9.7, it will remove any previous setup. Contains also the init script to manage phantomjs as a system service and the default configuration file. Tested on Ubuntu 12.04.
#! /bin/sh
# Init. script for phantomjs, based on Ubuntu 12.04 skeleton.
# Author: Anthony Lapenna <[email protected]>
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Phantomjs service"
NAME=phantomjs
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
@mrofi
mrofi / composerstyle.txt
Last active September 21, 2017 03:37 — forked from michaellouieloria/gist:f2ee272d1709a0e80f71
Phantomjs in Facebook PHP webdriver
require_once __DIR__ . "/vendor/autoload.php";
use \Facebook\WebDriver\Remote\WebDriverCapabilityType;
use \Facebook\WebDriver\Remote\RemoteWebDriver;
use \Facebook\WebDriver\WebDriverDimension;
$host = '127.0.0.1:8910';
$capabilities = array(
WebDriverCapabilityType::BROWSER_NAME => 'phantomjs',
'phantomjs.page.settings.userAgent' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0',