Skip to content

Instantly share code, notes, and snippets.

View ilhamarrouf's full-sized avatar
🏠
Working from home

Ilham Arrouf ilhamarrouf

🏠
Working from home
View GitHub Profile
@ilhamarrouf
ilhamarrouf / LearnSort.java
Created February 11, 2019 12:47
Sorting Java Tutorial
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;
/**
@ilhamarrouf
ilhamarrouf / DatabaseConnection.java
Created February 9, 2019 09:20
Singleton DB Connection
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
@ilhamarrouf
ilhamarrouf / setup.txt
Last active March 13, 2020 04:01
PHP NGINX MYSQL UBUNTU
#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version.
This tutorial is the improvised verision of this [tutorial on Digitalocean](https://www.digitalocean.com/community/tutorials/how-to-install-laravel-with-an-nginx-web-server-on-ubuntu-14-04) based on my experience.
## Install PHP 7 on Ubuntu
Run the following commands in sequence.
```
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@ilhamarrouf
ilhamarrouf / PhoneBook.java
Created January 25, 2019 15:40
Example Phone Book
import java.util.*;
import java.io.*;
public class PhoneBook {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
Scanner contactNameReader = new Scanner(System.in);
Scanner contactNumberReader = new Scanner(System.in);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Contact> contacts = new ArrayList<>();
import java.util.*;
import java.io.*;
public class IndexPrestasiSiswa {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> courses = new ArrayList<>();
ArrayList<String> courseNames = new ArrayList<>();
import java.util.Arrays;
public class ExampleDuplicateArray {
public static void main(String[] args) {
int[] source = {1,2,3,4,5,6,7,8,9};
int[] source1 = {1,2,3};
int[] destination = null;
System.out.println("Source array = " + Arrays.toString(source));
@ilhamarrouf
ilhamarrouf / Calculator.java
Created January 19, 2019 03:17
Example Calculator
import java.util.Scanner;
public class Calculator {
double x;
double y;
double result;
int Operation;
public static void main(String[] args) {
@ilhamarrouf
ilhamarrouf / Movie.java
Created January 6, 2019 05:10
Tugas kuliah
import java.util.Scanner;
import java.util.Calendar;
class Movie {
public static void main(String args[]) {
Scanner reader = new Scanner(System.in);
Integer currentYear = Calendar.getInstance().get(Calendar.YEAR);
System.out.print("Masukan nama anda : ");
@ilhamarrouf
ilhamarrouf / MakeSquare.java
Created January 5, 2019 10:26
Make square from length number
import java.util.Scanner;
class MakeSquare {
public static void main(String args[]) {
Scanner reader = new Scanner(System.in);
int a, b, c;
System.out.print("Masukan angka = ");
@ilhamarrouf
ilhamarrouf / Number.java
Created December 9, 2018 13:38
Introduction to Programming
import java.util.Scanner;
public class Number {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
System.out.print("Masukkan angka pertama: ");
long a = Integer.parseInt(reader.nextLine());
System.out.print("Masukkan angka kedua: ");
long b = Integer.parseInt(reader.nextLine());
System.out.println("Bilangan terbesar: " + Math.max(a, b));