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 / DateFormaterPlayGround.java
Created April 5, 2020 16:26
Business Application Design TK 2
import java.util.Calendar;
import java.util.Formatter;
import java.util.Locale;
import java.text.SimpleDateFormat;
public class DateFormaterPlayGround
{
String locale = "id";
public static void main(String[] args)
@ilhamarrouf
ilhamarrouf / command.sh
Last active June 16, 2023 09:56
Docker MySQL
docker run --name mysql -itd --restart=always \
--env="MYSQL_ROOT_PASSWORD=toor" \
--volume /srv/docker/mysql:/var/lib/mysql \
--publish 3306:3306 \
mysql:5.7
@ilhamarrouf
ilhamarrouf / main.go
Created November 3, 2019 04:31
GIN-Gionic binding uri
package main
import (
"github.com/gin-gonic/gin"
"net/http"
)
type Person struct {
ID string `uri:"id" binding:"required,uuid"`
Name string `uri:"name" binding:"required"`
@ilhamarrouf
ilhamarrouf / 20190924.sql
Created September 24, 2019 11:33
Tugas Kuliah
-- DDL
-- Create
CREATE TABLE `users` (`id` bigint unsigned not null auto_increment primary key,
`name` varchar(255) not null,
`email` varchar(255) not null,
`email_verified_at` timestamp null,
`password` varchar(255) not null,
`remember_token` varchar(100) null,
`created_at` timestamp null,
@ilhamarrouf
ilhamarrouf / MailTemplateParser.php
Created August 29, 2019 08:16
Simple PHP Template Parsing
<?php
class MailTemplateParser
{
protected $_openingTag = '{{';
protected $_closingTag = '}}';
protected $_emailValues;
@ilhamarrouf
ilhamarrouf / example.conf
Last active August 25, 2019 18:03
example virtual host php
server {
listen 80;
server_name example.com;
index index.php;
root /path/to/public;
location / {
try_files $uri /index.php$is_args$args;
}
@ilhamarrouf
ilhamarrouf / README.txt
Last active August 14, 2019 04:00
Setup OCI8 on Centos7
# Stop Apache and uninstall old versions of OCI8.
$ service httpd stop
$ pecl uninstall oci8
$ sudo yum install php-pear php-devel
$ pear download pecl/oci8
# The next commands depend on the version of oci8 downloaded above.
$ tar xvzf oci8-2.2.0.tgz
$ cd oci8-2.2.0/
$ phpize
@ilhamarrouf
ilhamarrouf / command.sh
Created August 12, 2019 07:05
Disable SELinux
setenforce 0
sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
@ilhamarrouf
ilhamarrouf / main.go
Created August 8, 2019 06:56
Stateful Goroutines
package main
import (
"fmt"
"math/rand"
"sync/atomic"
"time"
)
type readOp struct {
@ilhamarrouf
ilhamarrouf / config
Created August 7, 2019 09:13
Disabled selinux CentOS 7
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.