Skip to content

Instantly share code, notes, and snippets.

View SunDi3yansyah's full-sized avatar
Verified

Cahyadi Triyansyah SunDi3yansyah

Verified
View GitHub Profile
@SunDi3yansyah
SunDi3yansyah / install.sh
Created November 29, 2018 14:05 — forked from anhldbk/install.sh
Install Kong API Gateway on Ubuntu
sudo apt-get install netcat openssl libpcre3 dnsmasq procps perl
# for ubuntu 16.04 (xenial)
sudo apt-get -y install postgresql postgresql-contrib phppgadmin
sudo -i -u postgres
psql
CREATE USER kong; CREATE DATABASE kong OWNER kong;
ALTER USER kong WITH password 'kong';
@SunDi3yansyah
SunDi3yansyah / webpacker_rails.md
Created November 28, 2018 15:50 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
@SunDi3yansyah
SunDi3yansyah / .gitignore_global
Created November 28, 2018 13:42 — forked from jacobtomlinson/.gitignore_global
An example global gitignore file
# An example global gitignore file
#
# Place a copy if this at ~/.gitignore_global
# Run `git config --global core.excludesfile ~/.gitignore_global`
# Compiled source #
###################
*.com
*.class
*.dll
@SunDi3yansyah
SunDi3yansyah / laravel-multiple-env-setup.php
Created November 6, 2018 20:31 — forked from msankhala/laravel-multiple-env-setup.php
Setup Multiple Environment for Laravel 5 Developers Way
<?php
/*
|--------------------------------------------------------------------------
| Follow this instructions:
|--------------------------------------------------------------------------
|
| Laravel takes a dead simple approach to your application environments
| so you can just specify a machine name for the host that matches a
| given environment, then we will automatically detect it for you.
class SetDatabaseDefaults < ActiveRecord::Migration
def up
case ActiveRecord::Base.connection.adapter_name
when "MySQL", "Mysql2"
execute "ALTER DATABASE #{current_database} DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci"
when "SQLite"
# do nothing since SQLite does not support changing the database encoding and only supports unicode charsets
when "PostgreSQL"
# do nothing since PostgreSQL does not support changing the database encoding
@SunDi3yansyah
SunDi3yansyah / LinkHeaderPagination.php
Last active October 31, 2018 13:19
Laravel Middleware to setup pagination in headers
<?php
namespace App\Http\Middleware;
use Closure;
class LinkHeaderPagination
{
/**
* @param $request
@SunDi3yansyah
SunDi3yansyah / README.md
Created October 23, 2018 12:17 — forked from deizel/README.md
Multiple global Composer installations

Multiple global Composer installations

When setting up CI servers, it can sometimes be necessary to have different versions of Composer dependencies installed globally.

For example, when your CI server mainly deals with CakePHP 2.x and 3.x applications, where the coding standards vary.

This guide aims to walk you through how one might acheive this.

Composer home

@SunDi3yansyah
SunDi3yansyah / Authenticate.php
Last active October 22, 2018 17:13 — forked from joseluisq/1README.md
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Factory as Auth;
class Authenticate
{
/**
@SunDi3yansyah
SunDi3yansyah / Static Site Generators.md
Last active August 22, 2018 02:34 — forked from davatron5000/gist:2254924
Static Site Generators

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

@SunDi3yansyah
SunDi3yansyah / 00.md
Created August 3, 2018 21:37 — forked from maxivak/00.md
Sending emails with ActionMailer and Sidekiq

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.

ActionMailer

Create your mailer us usual: