Skip to content

Instantly share code, notes, and snippets.

View zafranf's full-sized avatar

Zafran Fadilah zafranf

View GitHub Profile
@zafranf
zafranf / Ubuntu-Server-LEMP-Setup-16.04.md
Last active March 13, 2018 07:59 — forked from marcuslilja/ubuntu-server-setup-16.04.md
Server Setup for Ubuntu 16.04

Server Setup for Ubuntu 16.04

The setup installs the following software:

  • Nginx
  • MariaDB
  • PHP
  • Git
  • Node
  • Composer
@zafranf
zafranf / imageoptim.php
Created June 1, 2017 18:18 — forked from ianmustafa/imageoptim.php
Optimalisasi Gambar dalam PHP menggunakan Imagick.
<?php
/* Maafkan kalo penamaan variabelnya berantakan :D
Ini juga agak lambat karena kompleksitasnya, terutama
di baris 61-95 (pembuatan gambar latar yang di-blur
untuk mengisi ruang kosong / menghindari crop)
*/
function imageoptim($imagepath, $savename) {
// Set imagepath default
$imagepath = "upload/source/{$savename}";
@zafranf
zafranf / README-Template.md
Created July 22, 2017 19:16 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@zafranf
zafranf / deploy-static-site-heroku.md
Created October 4, 2017 13:41 — forked from wh1tney/deploy-static-site-heroku.md
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

@zafranf
zafranf / ScrappingBCA
Created November 12, 2017 15:18 — forked from billyriantono/ScrappingBCA
Scrapping Mutasi BCA by adiputra
<?php
class ScrapBCA {
private $ipaddress;
private $user = 'user klik bca';
private $pass = 'pass klik bca';
private $bca_url = 'https://ibank.klikbca.com/';
private $bca_url_login = 'https://ibank.klikbca.com/authentication.do';
private $bca_url_menu = 'https://ibank.klikbca.com/nav_bar_indo/menu_bar.htm';
public function __construct() {
@zafranf
zafranf / accessh
Created December 20, 2017 05:24
SSH List script
#!/bin/bash
echo "###########################"
echo "# Choose SSH Access #"
echo "###########################"
echo "1) SSH to ..."
echo "0) exit"
echo
printf 'choose [1/2/3/0] : '

Server Setup for Debian 8 (jessie)

The setup installs the following software and features:

  • Add a new user
  • Install firewall
  • Nginx
  • PHP
  • MariaDB
  • Git
@zafranf
zafranf / 01-README.md
Created April 14, 2018 14:51 — forked from petemcw/01-README.md
Mac OS X LEMP Configuration

Mac OS X LEMP Configuration

This Gist is a collection of configuration files that can be used to easily setup a Homebrew-based LEMP stack on Mac OS X.

Files in this repository are numbered and named for ordering purposes only. At the top of each file is a section of metadata that denote what component the file belongs to and the default name & location of the file. Feel free to implement it however you want.

Note: some configuration files have hard-coded paths to my user directory -- fix it for your setup

Setup

@zafranf
zafranf / default
Created April 14, 2018 14:53 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@zafranf
zafranf / dir_is_empty.php
Created April 20, 2018 08:54 — forked from mistic100/dir_is_empty.php
[PHP] Check if a folder is empty
<?php
/**
* Check if a directory is empty (a directory with just '.svn' or '.git' is empty)
*
* @param string $dirname
* @return bool
*/
function dir_is_empty($dirname)
{
if (!is_dir($dirname)) return false;