Skip to content

Instantly share code, notes, and snippets.

View endymuhardin's full-sized avatar

Endy Muhardin endymuhardin

View GitHub Profile
@endymuhardin
endymuhardin / HelloWorld.java
Created January 8, 2011 13:27
contoh source file Java
public class HelloWorld{
public static void main(String[] xxx){
System.out.println("Hello World")
}
}
@endymuhardin
endymuhardin / contohValidasiBenar.java
Created January 10, 2011 14:22
logic untuk menghandle reversal request dengan validasi padanan payment dan selisih waktu dengan request sebelumnya
public void methodYangHarusDivalidasi(Object param1, Object param2) {
// validasi param
if(param1 == null){
throw new IllegalArgumentException("tidak boleh null");
// throw otomatis mengakhiri method
}
if(!param1.getClass().isAssignableFrom(BigDecimal.class)){
// tidak usah diproses
@endymuhardin
endymuhardin / .gitignore
Created January 11, 2011 03:38
Git Ignore File for commonly used IDE
# Eclipse
.settings
.metadata
.project
.classpath
Servers
bin
target
# SpringSource Tool Suite
@endymuhardin
endymuhardin / build.gradle
Created January 25, 2011 08:16
shell command untuk membuat struktur folder
springVersion = "3.0.5.RELEASE"
springSecurityVersion = "3.0.5.RELEASE"
slf4jVersion = "1.6.1"
logbackVersion = "0.9.27"
jodaTimeVersion = "1.6.2"
sourceCompatibility = 1.6
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
@endymuhardin
endymuhardin / remove-gitignored-files.sh
Created April 2, 2011 14:28
Sometime we accidentally commit files that should have been ignored. This command will remove it permanently from repository.
git filter-branch -f --index-filter 'git rm -r --cached --ignore-unmatch target .settings .project .classpath .springBeans \*/target\* \*/.settings\* \*/.springBeans \*/.project \*/.classpath ' HEAD
@endymuhardin
endymuhardin / create-poster.sh
Created June 27, 2011 10:42
Convert ogv to mp4 with H264 encoding, create poster, upload to server
ffmpeg -r 1 -t 1 -vframes 1 -i input-file.mp4 output-file.png
@endymuhardin
endymuhardin / bashrc
Created August 6, 2011 09:56
Instalasi Redmine di Tomcat
export JRUBY_HOME=/opt/jruby
export PATH=$PATH:$JRUBY_HOME/bin
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:property-placeholder location="
classpath*:jdbc.properties,
@endymuhardin
endymuhardin / LoketController.java
Created August 15, 2011 05:38
Membuat JSON Response untuk dijit.form.FilteringSelect
@Controller
public class LoketController {
@RequestMapping("/loket/json")
@ResponseBody
public Map<String, Object> loketJson(){
Loket l = new Loket();
l.setId(100);
l.setKode("L-001");
l.setNama("Loket 001");
@endymuhardin
endymuhardin / copy-backup-to-external.sh
Created August 26, 2011 08:26
Backup Script untuk Home Folder
rsync -avzPH /opt/downloads/backups /media/DATA2/