Skip to content

Instantly share code, notes, and snippets.

View herusdianto's full-sized avatar

Heru Rusdianto herusdianto

  • Bandung, West Java, Indonesia
View GitHub Profile
@herusdianto
herusdianto / Preferences.sublime-settings
Last active September 5, 2016 03:32
Sublime Text 3 Settings
{
"ignored_packages":
[
"Vintage"
],
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true,
"shift_tab_unindent": true,
"highlight_modified_tabs": true,
@herusdianto
herusdianto / laravel
Created August 13, 2016 05:15
Laravel Nginx Virtual Host Example
# /etc/nginx/sites-available/laravel
server {
listen 80;
listen [::]:80 ipv6only=on;
root /var/www/html/laravel/public;
index index.php index.html index.htm;
server_name laravel.dev;
@herusdianto
herusdianto / .zshrc
Last active January 21, 2017 14:12
.zshrc
# Path to your oh-my-zsh installation.
export ZSH=/home/heru/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@herusdianto
herusdianto / default
Last active August 20, 2017 23:25
Nginx default server configuration
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@herusdianto
herusdianto / InstallCert.java
Created November 19, 2015 03:54
Fix: SunCertPathBuilderException: unable to find valid certification path to requested target
/*
* here is the file from the following article:
* http://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/
*/
package com.aw.ad.util;
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@herusdianto
herusdianto / implode.groovy
Created June 10, 2015 08:21
Groovy Implode Array
def implode(ArrayList inputArray, String glueString)
{
/** Output variable */
String output = "";
if (inputArray.size() > 0)
{
StringBuilder sb = new StringBuilder();
sb.append(inputArray[0]);
@herusdianto
herusdianto / number_format.md
Last active August 29, 2015 14:21
Javascript Number To Local Format

Script:

var number;

number = 1000000;
number.toLocaleString();
number.toLocaleString('id-ID');

number = 1500000.59
number.toLocaleString();
@herusdianto
herusdianto / User.php
Created May 12, 2015 15:10
Laravel Eloquent lists multiple column.
<?php namespace App;
use DB;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
@herusdianto
herusdianto / User.php
Last active August 29, 2015 14:21
Laravel mutate another column to carbon object
<?php namespace App;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Database\Eloquent\Model;
/**
* Class User