Skip to content

Instantly share code, notes, and snippets.

View glendmaatita's full-sized avatar

Glend Maatita glendmaatita

  • Surabaya, Indonesia
View GitHub Profile
@glendmaatita
glendmaatita / twig
Created November 16, 2013 16:54
draft Artikel Emagz PHPI : Twig Template Engine
[Twig](http://twig.sensiolabs.org/) adalah template engine untuk PHP, dibuat oleh Fabien Potencier sebagai bagian dari project Symfony, dan saat ini sudah menjadi default template engine untuk Symfony. Twig secara syntax 100% sama dengan [Jinja](http://jinja.pocoo.org/), template engine untuk web application di Python.
Adapun banyaknya template engine ini, terutama di PHP, dipicu oleh semakin concern-nya para programmer untuk menulis kode yang bersih, rapi, dan paling utama adalah memisahkan kode untuk business process dan view (tampilan). Template engine berguna untuk memfasilitasi programmer untuk membuat view yang fleksibel dan benar-benar memisahkan kode view dari kode untuk business process dan logika.
Template engine untuk PHP sendiri sangat beragam karena pada dasarnya, kode PHP dapat digunakan untuk templating juga. Jika anda pernah memakai framework semisal CodeIgniter atau Kohana, mereka menggunakan kode PHP langsung untuk templating. Dengan kata lain, jika anda membuka file views anda, anda akan
@glendmaatita
glendmaatita / employees.sql
Last active August 23, 2018 11:58
Table Schema (Using MySQL)
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
-- --------------------------------------------------------
@glendmaatita
glendmaatita / ActivitiesStackHandler.kt
Last active May 20, 2021 04:05
Android - Activities Stack Handler
// Manually handle activity stack
// Android has many different mechanism on how to handle activities stack on each version
// Instead rely on native tool, we create this class to handle the stack
//
// How does it work?
//
// Make sure all of your activities is inherited from a `BaseActivity`
// When an activity launched, call `super.onCreate()` method from `BaseActivity`
// `BaseActivity@onCreate` is simple, just call `addActivity(this)` method to add your activity to the stack
// Don't forget to remove it from stack, by calling `removeActivity(this)`, when the activity is destroyed
@glendmaatita
glendmaatita / ucwords.dart
Created May 20, 2021 04:05
Dart Upper Case Words (ucwords)
var words = "hey i am here. HOW ARE YOU?";
var ucwords = words.toLowerCase()
.split(" ")
.map((e) => "${e[0].toUpperCase()}${e.substring(1)}")
.join(" ");
print(ucwords); // "Hey I Am Here. How Are You?"
@glendmaatita
glendmaatita / backend-recruitment.md
Last active August 30, 2021 13:07
Backend Recruitment Test

We already have fake server here. This fake server will return a list of users in certain format like this.

{
  "data": [
    {
      "id": 1,
      "name": "Leanne Graham",
      "username": "Bret",
      "email": "Sincere@april.biz",

"address": {

@glendmaatita
glendmaatita / mobile-recruitment-test.md
Last active August 23, 2021 02:18
Mobile Developer Recruitment Test

We already have fake server here. This fake server will return a list of users in certain format like this.

{
  "data": [
    {
      "id": 1,
      "name": "Leanne Graham",
      "username": "Bret",
      "email": "Sincere@april.biz",

"address": {

@glendmaatita
glendmaatita / frontend-recruitment.md
Created August 30, 2021 13:08
frontend-recruitment

We already have fake server here. This fake server will return a list of users in certain format like this.

{
  "data": [
    {
      "id": 1,
      "name": "Leanne Graham",
      "username": "Bret",
      "email": "Sincere@april.biz",

"address": {

@glendmaatita
glendmaatita / microk8s-comparison.csv
Last active April 18, 2023 23:01
microk8s comparison with k3s, minikube, and managed k8s
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 8. in line 1.
Feature/Aspect;Microk8s;Managed Kubernetes Clusters;K3s;Minikube
Target Use Case;Developers, small deployments, edge computing, IoT;Larger deployments, enterprises;Edge computing, IoT, resource-constrained environments;Local development, testing
Installation;Easy, single-node setup;Provider managed, multiple-node setup;Easy, single-node setup;Easy, single-node setup
Management;Self-managed, minimal administrative tasks;Provider managed, full administrative support;Self-managed, minimal
# Service Account
resource "google_service_account" "vm-sa" {
account_id = "vm-sa"
display_name = "VM Service Account"
}
resource "google_project_iam_member" "vm-iam" {
project = "my-gcp-project
role = "roles/container.admin"
member = "serviceAccount:${google_service_account.vm-sa.email}"
@glendmaatita
glendmaatita / kyverno-1.sh
Last active April 27, 2023 03:51
Kyverno-1
~$ gcloud container clusters describe my-k8s --format='value(privateClusterConfig.masterIpv4CidrBlock)' --region=asia-southeast2-a
# 172.18.0.0/28