Skip to content

Instantly share code, notes, and snippets.

View ipanardian's full-sized avatar

Ipan Ardian ipanardian

View GitHub Profile
@ipanardian
ipanardian / NullToEmptyString.php
Created April 2, 2019 03:02
Convert null value from database to empty string for response
<?php
namespace App\Traits;
/**
* Convert null value from database to empty string for response
*
* Usage:
* use Illuminate\Database\Eloquent\Model;
* use App\Traits\NullToEmptyString;
*
@ipanardian
ipanardian / Instal_and_configure_nginx.md
Last active July 18, 2018 11:06
Install and Configure Nginx on Mac

Install

$ brew install nginx

Setelah install jalankan nginx.
$ sudo nginx

Testing

Test apakah nginx sudah running, buka url http://localhost:8080.

Ganti default port

@ipanardian
ipanardian / save.php
Last active February 16, 2018 12:16
Async Upload File
<?php
/**
* PHP Example for jQuery Image Reader
*/
header('Content-type: application/json; charset=utf-8');
try {
@ipanardian
ipanardian / onChange.js
Created December 22, 2017 07:06
Watch Object Changes with Proxy API
'use strict';
function onChange(object, onChange) {
const handler = {
get(target, property, receiver) {
try {
return new Proxy(target[property], handler);
} catch (err) {
return Reflect.get(target, property, receiver);
}
@ipanardian
ipanardian / io.redis.redis-server.plist
Created November 30, 2017 04:24
Launchd script Redis
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>io.redis.redis-server</string>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>