<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><generator uri="https://jekyllrb.com/" version="4.3.2">Jekyll</generator><link href="https://harpi.ch/feed.xml" rel="self" type="application/atom+xml" /><link href="https://harpi.ch/" rel="alternate" type="text/html" hreflang="en-US" /><updated>2025-05-19T22:43:54+07:00</updated><id>https://harpi.ch/feed.xml</id><title type="html">Harpi’s Blog (@piharpi)</title><subtitle>Write about what interests to him and as a journal for documentation things that he learned.</subtitle><author><name>Ch. Harpi</name><email>id.harpi@pm.me</email></author><entry><title type="html">Mengenal metodologi BEM CSS</title><link href="https://harpi.ch/metodologi-bem-css/" rel="alternate" type="text/html" title="Mengenal metodologi BEM CSS" /><published>2020-04-26T01:00:00+07:00</published><updated>2020-04-26T01:00:00+07:00</updated><id>https://harpi.ch/metodologi-bem-css</id><content type="html" xml:base="https://harpi.ch/metodologi-bem-css/">&lt;blockquote&gt;
  &lt;p&gt;There are only two hard things in Computer Science: cache invalidation and naming things.
– Phil Karlton.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;tldr&quot;&gt;TL;DR&lt;/h2&gt;

&lt;p&gt;Konvensi penamaan suatu hal pada pemrograman — memang terkadang menjadi masalah, sering membuat kerumitan programmer dan koléga-nya, termasuk memberi nama class selector CSS, hal yang sepele tapi ternyata bisa menjadi senjata makan tuan ketika bekerja dengan skala file CSS yang besar.&lt;/p&gt;

&lt;p&gt;Sering terjadi; suatu ketika membuka file project yang semula kita paham dengan baris kode yang ditulis; seketika juga lupa apa maksud baris kode tersebut, kemungkinan dikarenakan struktur kode yang berantakan, penamaan class selector yang tidak memilki arti/makna yang jelas dan juga tidak memiliki kekonsistenan gaya penulisan, sehingga hanya Tuhan saja yang mengetahui maksud baris kode tersebut.&lt;/p&gt;

&lt;p&gt;Beruntungnya terdapat beberapa metodologi CSS yang bisa digunakan untuk mengatasi masalah di atas yaitu; SMACSS, OOCSS, SUITCSS, Atomic dan &lt;strong&gt;BEM&lt;/strong&gt; yang mana akan dibahas tulisan ini.&lt;/p&gt;

&lt;p&gt;Metodologi BEM hadir bertujuan untuk menyelesaikan permasalahan di atas yaitu &lt;em&gt;naming convention&lt;/em&gt;/konvensi penamaan dan struktur pada classes di HTML dan CSS, sehingga kode dapat dipahami dengan mudah oleh developer, BEM ini &lt;a href=&quot;http://bem.info&quot;&gt;dikembangkan&lt;/a&gt; oleh Yandex perusahaan teknologi asal Rusia, BEM termasuk metode yang sering dipakai para developer saat ini karena memilki beberapa benefits: modularity, reusabililty dan structure.&lt;/p&gt;

&lt;h4 id=&quot;dive-in-bem&quot;&gt;Dive in BEM&lt;/h4&gt;

&lt;p&gt;BEM sendiri merupakan singkatan dari &lt;strong&gt;B&lt;/strong&gt;lock, &lt;strong&gt;E&lt;/strong&gt;lement, &lt;strong&gt;M&lt;/strong&gt;odifier dari &lt;strong&gt;tiga kata&lt;/strong&gt; tersebut miliki konsep kerja masing-masing, namun sebelum menjelaskan konsep itu, saya akan memberikan ilustrasi pengimplementasian BEM supaya lebih mudah dipahami.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Katakanlah saya akan membuat sebuah komponen yang saya beri nama &lt;strong&gt;card&lt;/strong&gt; yang mana komponen ini memiliki gambar &lt;strong&gt;background,&lt;/strong&gt; user &lt;strong&gt;avatar,&lt;/strong&gt; &lt;strong&gt;deskripsi&lt;/strong&gt; singkat dan &lt;strong&gt;footer&lt;/strong&gt; yang berisi external &lt;strong&gt;link&lt;/strong&gt; (github, twitter), berikut ini ilustrasi dalam bentuk hand draw.&lt;/p&gt;

&lt;figure&gt;
  &lt;img src=&quot;/metodologi-bem-css/bem-css.png&quot; alt=&quot;Konsep yang akan diterapkan dengan BEM CSS.&quot; /&gt;
  &lt;figcaption&gt;Fig 1. Konsep yang akan diterapkan dengan BEM CSS.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Dari gambar di atas saya akan menjelaskan mana yang bagian block, element dan modifier, berikut ini penjelasanya:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Block&lt;/strong&gt; merupkan entity yang berdiri sendiri, memiliki makna dirinya sendiri, pada gambar di atas bahwa card bertindak sebagai wrapper(pembungkus) dari element yang didalamnya, aturan penamaan block ialah &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.namablock&lt;/code&gt;, maka block card menjadi &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card&lt;/code&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Element&lt;/strong&gt; bagian dari &lt;strong&gt;Block&lt;/strong&gt; yang tidak berdiri sendiri dan secara &lt;em&gt;semantic&lt;/em&gt; bergatung pada &lt;strong&gt;Block&lt;/strong&gt;, contoh pada gambar di atas : background, avatar, title, description, footer merupakan bagian-bagian dari &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card&lt;/code&gt;, karena posisinya berada didalam &lt;strong&gt;Block&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card&lt;/code&gt;, aturan penamaan menggunakan double underline(__) setelah nama block diikuti nama element &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.namablock__namaelement&lt;/code&gt; maka masing-masing element tersebut &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card__background&lt;/code&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card__avatar&lt;/code&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card__title&lt;/code&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card__description&lt;/code&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card__footer&lt;/code&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Modifier&lt;/strong&gt; sebuah state yang ditugaskan untuk melakukan pengubahan &lt;em&gt;behaviour&lt;/em&gt; (bentuk, penampilan, ukuran) dari &lt;strong&gt;Block&lt;/strong&gt; ataupun &lt;strong&gt;Element&lt;/strong&gt;. Katakanlah saya ingin mengubah penampilan yang semula avatar kotak menjadi avatar berbentuk radius circle/melingkar, aturan penamaan modifier ini menggunakan double hyphen(--) setelah nama &lt;strong&gt;Block&lt;/strong&gt; atau juga &lt;strong&gt;Element,&lt;/strong&gt; dan diikuti nama modifiernya &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.namablock__namaelement--namamodifier&lt;/code&gt; maka yang dihasilkan &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card__avatar--circle&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;*)&lt;/strong&gt; Kita bisa membuat &lt;a href=&quot;https://en.bem.info/methodology/naming-convention/#your-naming-system&quot;&gt;skema penamaan sendiri&lt;/a&gt;, yang terpenting skema tersebut dapat membedakan antara block, element, modifier, yang mana sudah menjadi ketentuan dari metodologi BEM, pada tulisan ini skema penamaan mengacu pada &lt;a href=&quot;https://en.bem.info/methodology/naming-convention/#two-dashes-style&quot;&gt;Two Dashes Style&lt;/a&gt;.&lt;/p&gt;

&lt;figure&gt;
  &lt;img src=&quot;/metodologi-bem-css/ilustrasi-bem-css.png&quot; alt=&quot;Ilustrasi implementasi BEM CSS.&quot; /&gt;
  &lt;figcaption&gt;Fig 2. Ilustrasi implementasi BEM CSS.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Jika ilustrasi di atas kita tuliskan di CSS, hasil penyusunan struktur class selector akan lebih terlihat tegas, mempunyai makna yang jelas, karena setiap class selector memilki peran dan saling berkaitan.&lt;/p&gt;

&lt;div class=&quot;language-scss highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// Block tanpa ada simbol apapun,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// sebagai inti komponen&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.card&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Element adalah bagian dari Block&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Element tanda underscore 2 kali&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// diikuti nama element setelah block&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.card__background&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.card__avatar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.card__title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.card__description&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.card__footer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Block lagi&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.link&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Modifier mengubah behaviour Block atapun Element&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Penamaan Block dengan Modifier,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// 2 hyphens setelah block ataupun setelah element&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.link--blue&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.link--light&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Block dan Element dan Modifier jika digabung&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.card__avatar--circle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.card__avatar--rounded&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;pros-and-cons&quot;&gt;Pros and Cons&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pro,&lt;/strong&gt; BEM jelas less-confusing, dengan adanya &lt;strong&gt;Block&lt;/strong&gt; sebagai inti komponen(wrapper), &lt;strong&gt;Element&lt;/strong&gt; bagian dari block, dan &lt;strong&gt;Modifier&lt;/strong&gt; sebagai pengubah behaviour, kita bisa mengerti peran masing-masing class selector dan setiap class selector memilki penamaan &lt;em&gt;unique/&lt;/em&gt;unik, sehingga kita tidak lagi mengalami konflik dengan nama class selector yang lain (&lt;strong&gt;Modularity&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;Jika suatu nama block sudah tersedia, maka seharusnya itu dapat digunakan kembali sehingga tidak terjadi duplikasi nama class selector, juga memiliki gaya penulisan yang konsisten dan akan mengurangi jumlah baris css yang ditulis (&lt;strong&gt;Reusabilty&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;Struktur gaya penulisan nama class selector yang sederhana tetapi jelas, mempermudah developer untuk bisa mengingat kembali kode yang ia tulis ataupun pada saat prosses debugging (&lt;strong&gt;Structure&lt;/strong&gt;).&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Kontra,&lt;/strong&gt; harus melakukan &lt;em&gt;nesting/repeated&lt;/em&gt; penamaan, dan harus memberikan double-underscore(__) atau double-hyphen(--) pada saat pemberian nama class selector; yang mana beberapa orang tidak menyukai, dan suatu saat nama class selector akan semakin panjang tergantung pada nama block dan elemen yang digunakan.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Solusi Kontra,&lt;/strong&gt; dapat diatasi dengan menggunakan preprocessor &lt;a href=&quot;https://sass-lang.com/&quot;&gt;Sass&lt;/a&gt;, sehingga selector tidak terlalu panjang, akan terlihat lebih rapi dan lebih tersetruktur, namun underscore dan hyphen sebagai pembeda antara block, element, modifier harus tetap digunakan yang mana bagian dari &lt;a href=&quot;https://en.bem.info/methodology/key-concepts/&quot;&gt;konsep&lt;/a&gt; BEM.&lt;/p&gt;

&lt;div class=&quot;language-scss highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;.card&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;__background&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;__avatar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--circle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--rounded&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;__title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;__description&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;__footer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.link&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--blue&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--light&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Implementasi class selector yang sudah dibuat pada HTML, bisa ditebak apa yang terjadi dengan &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card__avatar--circle&lt;/code&gt;? dapat dijelaskan bahwa modifier &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--circle&lt;/code&gt; akan mengubah element &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;__avatar&lt;/code&gt; yang dimiliki oleh block &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.card&lt;/code&gt; menjadi berbentuk bulat, cukup &lt;em&gt;meaningful&lt;/em&gt; bukan?&lt;/p&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Block .card sebuah inti component card --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;card&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Element .card__background bagian dari block .card --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;card__background&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Element .card__avatar bagian dari block .card --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Modifier .card__avatar--circle
  mengubah bentuk Element .card__avatar menjadi bulat --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;card__avatar card__avatar--circle&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;https://harpi.rocks/assets/img/avatar.jpg&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;alt=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Mahendrata Harpi&quot;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Element .card__title bagian dari block .card --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;card__title&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Mahendrata Harpi&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Element .card__description bagian dari block .card --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;card__description&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    He&apos;s write in Bahasa about what interests him and as a journal for
    documentation things that he learned.
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Element .card__footer bagian dari block .card --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;card__footer&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    Follow me on

    &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Block .link component --&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Modifier .link--light mengubah warna .link menjadi putih --&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;link link--light&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://github.com/piharpi&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;_blank&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;noopener noreferrer&quot;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;GitHub&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    or
    &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Block .link component --&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Modifier .link--blue mengubah warna .link menjadi biru --&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;link link--blue&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://twitter.com/piharpi&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;_blank&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;noopener noreferrer&quot;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Twitter&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;output-learning&quot;&gt;Output Learning&lt;/h2&gt;

&lt;p&gt;Dibawah ini merupakan hasil komponen card yang saya buat berdasarkan konsep di atas, sengaja tidak saya lampirkan CSS karena terlalu panjang nantinya, namun hasil dan source code bisa diakses &lt;a href=&quot;https://codesandbox.io/s/bem-css-y55p2?file=/index.html&quot;&gt;disini&lt;/a&gt; atau playground dibawah ini.&lt;/p&gt;

&lt;iframe src=&quot;https://codesandbox.io/embed/bem-css-y55p2?autoresize=1&amp;amp;fontsize=14&amp;amp;hidenavigation=1&amp;amp;view=preview&quot; style=&quot;width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;&quot; title=&quot;BEM CSS&quot; allow=&quot;accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr&quot; sandbox=&quot;allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts&quot;&gt;&lt;/iframe&gt;
&lt;figcaption&gt;Embed Hasil dari metodologi BEM CSS &lt;/figcaption&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;BEM adalah sebuah metode &lt;em&gt;naming convention&lt;/em&gt; yang bertujuan menulis secara jelas selector/classes sehingga memiliki makna yang tegas, tujuan penamaan dapat diprediksi(&lt;em&gt;predictable)&lt;/em&gt;, sehingga sesama rekan kerja mempunyai standar penulisan yang jelas, dan tidak saling membingungkan.&lt;/p&gt;

&lt;p&gt;menggunakan BEM memang &lt;strong&gt;bukan&lt;/strong&gt; sebuah keharusan, kembali pada hal yang dikerjakan apakah sebuah pekerjaan skala kecil dan apakah tanpa BEM pekerjaan bisa &lt;em&gt;maintainable&lt;/em&gt; atau sebaliknya, atau tergantung preferensi masing-masing.&lt;/p&gt;

&lt;p&gt;Namun, menurut opini saya menggunakan BEM kode css menjadi lebh rapi, memiliki aturan penulisan yang sama antar rekan kerja, mencegah terjadinya redundansi kode css, karena tingkat &lt;a href=&quot;https://specificity.keegan.st/&quot;&gt;CSS specifity&lt;/a&gt; yang jelas.&lt;/p&gt;

&lt;p&gt;Masih pengen gali lebih dalam tentang BEM? &lt;a href=&quot;https://en.bem.info/methodology/quick-start/&quot;&gt;kunjungi&lt;/a&gt;
situs resminya.&lt;/p&gt;

&lt;h5 id=&quot;resources&quot;&gt;Resources&lt;/h5&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://getbem.com/introduction/&quot;&gt;http://getbem.com/introduction/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://en.bem.info/methodology/&quot;&gt;https://en.bem.info/methodology/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://css-tricks.com/bem-101/&quot;&gt;https://css-tricks.com/bem-101/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Ch. Harpi</name><email>id.harpi@pm.me</email></author><category term="css" /><category term="frontend" /><category term="cleancode" /><summary type="html">There are only two hard things in Computer Science: cache invalidation and naming things. – Phil Karlton.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://harpi.ch/metodologi-bem-css/ilustrasi-bem-css.png" /><media:content medium="image" url="https://harpi.ch/metodologi-bem-css/ilustrasi-bem-css.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Cara ribet memperbarui forked repo</title><link href="https://harpi.ch/cara-memperbarui-fork-repository/" rel="alternate" type="text/html" title="Cara ribet memperbarui forked repo" /><published>2020-01-29T01:00:00+07:00</published><updated>2020-01-29T01:00:00+07:00</updated><id>https://harpi.ch/cara-memperbarui-fork-repository</id><content type="html" xml:base="https://harpi.ch/cara-memperbarui-fork-repository/">&lt;p&gt;Berawal dari saya pengen memperbarui repo yang tua dari suatu organisasi, niatnya pengen rumat ulang nih, ternyata dari orginal reponya ada update, sekalian buat artikel deh, lebih kurang gambaranya seperti ini.&lt;/p&gt;

&lt;figure&gt;
&lt;img src=&quot;/cara-memperbarui-fork-repository/repo.png&quot; alt=&quot;ilustrasi repo yang mau diupdate&quot; /&gt;
&lt;figcaption&gt;Figure 1. Diagram repository&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Ada dua cara untuk memperbarui forked repository menggunakan web interface yang disediakan oleh github tapi ribet, atau melalui terminal yang lebih ribet lagi.&lt;/p&gt;

&lt;h3 id=&quot;melalui-github-boring-way-&quot;&gt;Melalui Github (boring way) 😾&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;Buka repo yang hasil fork di Github.&lt;/li&gt;
  &lt;li&gt;Klik &lt;strong&gt;Pull Requests&lt;/strong&gt; di sebelah kanan, lalu &lt;strong&gt;New Pull Request&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Akan memunculkan hasil compare antara repo upstream dengan repo kamu(forked repo), dan jika menyatakan “There isn’t anything to compare.”, tekan link &lt;strong&gt;switching the base&lt;/strong&gt;, yang mana sekarang repo kamu(forked repo) akan dibalik menjadi base repo dan repo upstream menjadi head repo.&lt;/li&gt;
  &lt;li&gt;Tekan &lt;strong&gt;Create Pull Request&lt;/strong&gt;, beri judul pull request, Tekan &lt;strong&gt;Send Pull Request&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Tekan &lt;strong&gt;Merge Pull Request&lt;/strong&gt; dan &lt;strong&gt;Confirm Merge&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;*) pastikan kamu tidak merubah apapun pada forked repo, supaya melakukan merge secara otomatis, kalo tidak ya paling2 konflik.&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;melalui-terminal-️&quot;&gt;Melalui terminal ⌨️&lt;/h3&gt;

&lt;p&gt;Tambahkan remote alamat repository yang aslinya disini tak beri nama &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;upstream&lt;/code&gt;., ganti &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ORIGINAL_OWNER&lt;/code&gt; dan &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ORIGINAL_REPO&lt;/code&gt; dengan alamat repo aslimu.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git add remote upstream git@github.com:ORIGINAL_OWNER/ORIGINAL_REPO.git
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git remote &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; origin git@github.com:piharpi/www.git &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;fetch&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# forked repo&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; origin git@github.com:piharpi/www.git &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;push&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# forked repo&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; upstream git@github.com:ORIGINAL_OWNER/ORIGINAL_REPO.git &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;fetch&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# upstream repo / original repo&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; upstream git@github.com:ORIGINAL_OWNER/ORIGINAL_REPO.git &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;push&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# upstream repo / original repo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Checkout ke local branch &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;master&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git checkout master
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Switched to branch &lt;span class=&quot;s1&quot;&gt;&apos;master&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Jika sudah, Merge local repo dengan remote &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;upstream/master&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git merge upstream/master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Terakhir push local repo ke remote &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;origin&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git add &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git commit &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;updating origin repo&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git push &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; origin master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Selamat mencoba cara ribet ini, semoga bisa dipahami, saya sendiri lebih senang melalui terminal, klo ada yang ribet kenapa cari yang mudah.&lt;/p&gt;

&lt;h5 id=&quot;resources&quot;&gt;Resources&lt;/h5&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork&quot;&gt;Syncing a fork&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://rick.cogley.info/post/update-your-forked-repository-directly-on-github/#top&quot;&gt;Update your fork directly on Github&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Ch. Harpi</name><email>id.harpi@pm.me</email></author><category term="tips" /><category term="git" /><category term="software" /><summary type="html">Berawal dari saya pengen memperbarui repo yang tua dari suatu organisasi, niatnya pengen rumat ulang nih, ternyata dari orginal reponya ada update, sekalian buat artikel deh, lebih kurang gambaranya seperti ini.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://harpi.ch/cara-memperbarui-fork-repository/repo.png" /><media:content medium="image" url="https://harpi.ch/cara-memperbarui-fork-repository/repo.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Mengenal shell di lingkungan Linux</title><link href="https://harpi.ch/apa-itu-shell/" rel="alternate" type="text/html" title="Mengenal shell di lingkungan Linux" /><published>2020-01-25T11:58:47+07:00</published><updated>2020-01-25T11:58:47+07:00</updated><id>https://harpi.ch/apa-itu-shell</id><content type="html" xml:base="https://harpi.ch/apa-itu-shell/">&lt;p&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=tc4ROCJYbm0&amp;amp;t=70&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Dulu&lt;/a&gt; Sebelum adanya &lt;abbr title=&quot;Graphical User Interface&quot;&gt;GUI&lt;/abbr&gt; cara kita berinteraksi dengan komputer menggunakan &lt;abbr title=&quot;Command Line Interface&quot;&gt;CLI&lt;/abbr&gt; yaitu mengetik baris perintah pada sebuah antarmuka dalam bentuk baris teks seperti 👇, namun saat ini penggunaan &lt;abbr title=&quot;Command Line Interface&quot;&gt;CLI&lt;/abbr&gt; juga masih sering digunakan khususnya dikalangan para developer.&lt;/p&gt;

&lt;figure&gt;
&lt;img src=&quot;/apa-itu-shell/terminal_nginx.gif&quot; alt=&quot;installing nginx in ubuntu&quot; /&gt;
&lt;figcaption&gt;Fig 1. Terminal emulator, instalasi package dan check service.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Jika kamu pernah menggunakan unix/linux, mungkin pernah menggunakan program diatas, atau setiap hari menggunakannya untuk mengeksekusi suatu perintah melalui &lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_terminal_emulators&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;terminal emulator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Pernahkah kita berpikir 🤔️ bagaimana perintah tersebut bisa dipahami oleh komputer?. Kita&lt;sup id=&quot;user&quot;&gt;&lt;a href=&quot;#user-ref&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt; tidak bisa secara langsung berkomunikasi dengan sebuah hardware komputer, maka dari itu kita membutuhkan sebuah sistem operasi, dalam sebuah sistem operasi terdapat kernel; &lt;strong&gt;Kernel&lt;/strong&gt; salah satu bagian program dari sistem operasi komputer, yang bertindak menjembatani antara perangkat lunak dengan perangkat keras.&lt;/p&gt;

&lt;figure&gt;
&lt;img src=&quot;/apa-itu-shell/kernel.png&quot; alt=&quot;kernel central of operating system&quot; /&gt;
&lt;figcaption&gt;Fig 2. Bagan kernel.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Kernel memfasilitasi interaksi antara komponen perangkat keras dan perangkat lunak, berperan untuk menangani permintaan input/output dari perangkat lunak, selanjutnya menerjemahkannya ke dalam pemrosesan data untuk diinstruksikan ke CPU, sehingga Hardware(cpu, memory, devices) mengerti perintah yang dimaksud dari pengguna.&lt;/p&gt;

&lt;p&gt;Ketika kita memberikan suatu perintah pada terminal emulator, kernel tidak langsung mengerti perintah yang kita berikan, disini membutuhkan suatu interface sebagai perantara menuju kernel yaitu &lt;strong&gt;Shell&lt;/strong&gt;.&lt;/p&gt;

&lt;figure&gt;
&lt;img src=&quot;/apa-itu-shell/shell.png&quot; alt=&quot;shell&quot; /&gt;
&lt;figcaption&gt;Fig 3. Bagan komunikasi shell.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;&lt;mark&gt;Shell adalah sebuah command-line interpreter; program yang berperan sebagai penerjemah perintah yang diinputkan oleh User yang melalui terminal&lt;/mark&gt;, sehingga perintah tersebut bisa dimengerti oleh si Kernel.&lt;/p&gt;

&lt;p&gt;Login shell biasanya ditetapkan oleh local System Administrator ketika pada saat pertama user kamu dibuat, kamu bisa lihat login shell yang sedang kamu gunakan dengan perintah dibawah ini.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$SHELL&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# atau&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Setiap shell mempunyai default prompt. beberapa shell yang paling umum:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;dollar sign&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;c&quot;&gt;# sh, ksh, bash&lt;/span&gt;
% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;percent sign&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;# csh, tcsh&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h5 id=&quot;terminologi-pada-shell-prompt&quot;&gt;Terminologi pada shell prompt&lt;/h5&gt;

&lt;p&gt;Shell prompt adalah tempat dimana kita menuliskan suatu perintah, berikut adalah terminologinya ini membantu, jika kamu ingin mengetahui bagian-bagianya.&lt;/p&gt;

&lt;figure&gt;
&lt;img src=&quot;/apa-itu-shell/term_shell_prompt.png&quot; alt=&quot;shell&quot; /&gt;
&lt;figcaption&gt;Fig 4. Bagian-bagin dari shell prompt.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Dibawah ini salah satu contoh perintah sederhana untuk menampilkan sebuah arsitektur CPU komputer yang sedang saya gunakan.&lt;/p&gt;

&lt;figure&gt;
&lt;img src=&quot;/apa-itu-shell/terminal_lscpu.gif&quot; alt=&quot;installing nginx in ubuntu&quot; /&gt;
&lt;figcaption&gt;Fig 5. Menampilkan informasi tentang arsitektur CPU.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Dari perintah yang contohkan diatas, ketika mengetikan suatu inputan perintah di terminal dan menekan &lt;kbd&gt;ENTER&lt;/kbd&gt;, maka shell akan mengubah perintah yang diberikan menjadi bahasa yang bisa dipahami oleh kernel, dan Kernel menerjemahkannya ke dalam pemrosesan data untuk diintruksikan ke Hardware sehingga menghasilkan output yg sesuai dengan perintah user.&lt;/p&gt;

&lt;p&gt;Shell mempunyai beberapa macam dan turunan, berikut yang paling umum.&lt;/p&gt;

&lt;figure&gt;
&lt;img src=&quot;/apa-itu-shell/shell_evolution.png&quot; alt=&quot;shell evolution&quot; /&gt;
&lt;figcaption&gt;Fig 6. Perkembangan shell dari tahun ke tahun.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Sedikit penjelasan dari gambar diatas.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Bourne shell &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sh&lt;/code&gt;
Dikembangkan oleh Stephen Bourne di Bell Labs, yang kala itu sebagai pengganti Thompson shell(diciptakan Ken Thompson), banyak sistem unix-like tetap memiliki &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/bin/sh&lt;/code&gt;—yang mana menjadi symbolic link atau hard link, bahkan ketika shell lain yang digunakan tetap &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sh&lt;/code&gt; adalah sebagai dasarnya, sebagai kompatibilitas perintah.&lt;/li&gt;
  &lt;li&gt;Korn shell &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ksh&lt;/code&gt; Unix shell yang dikembangkan oleh David Korn di Bell Labs,
inisialisasi pengembangan ini berdasar pada source code Bourne shell, namun juga memiliki fitur &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;csh&lt;/code&gt; dan &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sh&lt;/code&gt;, pengembanganya pun pada saat saya menulis ini pun terus &lt;a href=&quot;http://github.com/att/ast&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;terawat&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Bourne again shell &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bash&lt;/code&gt;
adalah proyek ini open source &lt;a href=&quot;http://gnu.org/software/bash/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;GNU project&lt;/a&gt; memiliki kompatibel dengan &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sh&lt;/code&gt; yang menggabungkan fitur penting dari &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ksh&lt;/code&gt; dan &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;csh&lt;/code&gt;, dan menjadi salah satu shell yang paling umum digunakan (umumnya menjadi default shell login Linux dan Apple’s macOS Mojave).&lt;/li&gt;
  &lt;li&gt;Z shell &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;zsh&lt;/code&gt; ini mempunyai wadah komunitasnya disebutnya &lt;a href=&quot;http://ohmyz.sh/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;“Oh My Zsh”&lt;/a&gt;, plugin dan theme &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;zsh&lt;/code&gt; bisa kita temukan di komunitas ini, saya saat ini menggunakan &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;zsh&lt;/code&gt;, shell ini juga menjadi default dari sistem operasi macOS Catalina, yang menggantikan bash.&lt;/li&gt;
  &lt;li&gt;friendly interactive shell &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fish&lt;/code&gt;
yah sesuai dengan &lt;a href=&quot;http://fishshell.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;deskripsi&lt;/a&gt; di web nya, menurut saya shell ini fun banget, fitur yang saya sukai dari shell ini autosuggestions, dan konfigurasi yang mudah melalui web based.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Masih banyak yang belum dijelaskan pada tulisan ini jika masih tertarik, baca lebih &lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_command-line_interpreters#Operating_system_shells&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;banyak&lt;/a&gt; dan juga &lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_command_shells&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;komparasinya&lt;/a&gt; masing-masing shell.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Jika kamu tertarik untuk mengubah default shell login pada sistem operasi, kamu bisa menginstall dengan cara mengikuti didokumentasi/cara penginstalan masing-masing shell disini saya tidak membahas karena distro yang kita pakai mungkin berbeda-beda.&lt;/p&gt;

&lt;p&gt;Untuk menjadikan default shell login pada OS bisa menggunakan perintah ini.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# command&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;chsh &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;options] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;LOGIN]

&lt;span class=&quot;c&quot;&gt;# contoh penggunaan&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;chsh &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /user/bin/zsh harpi
&lt;span class=&quot;c&quot;&gt;# mengubah default shell user harpi menjadi zsh shell.&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;reboot

&lt;span class=&quot;c&quot;&gt;# atau kamu juga bisa mengubah file /etc/passwd dan edit secara manual user shellnya.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# jika masih bingung manfaatkan perintah man untuk melihat manual page.&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;man chsh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Terakhir untuk tulisan ini, shell memiliki berbagai macam, pilihlah shell yang sesuai dengan keinginanmu untuk menunjang produktivitas dan sesuaikan dengan kebutuhan, terlalu banyak plugin dan kebingungan memilih theme itu buruk 😁.&lt;/p&gt;

&lt;p&gt;Terimakasih sudah baca, &lt;em&gt;penulis menerima kritik dan saran.&lt;/em&gt;&lt;/p&gt;

&lt;h5 id=&quot;resources&quot;&gt;Resources&lt;/h5&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://developer.ibm.com/tutorials/l-linux-shells/&quot;&gt;Evolution shells in Linux&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.linfo.org/kernel.html&quot;&gt;Kernel Defintion&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.cis.rit.edu/class/simg211/unixintro/Shell.html&quot;&gt;The Shell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Ch. Harpi</name><email>id.harpi@pm.me</email></author><category term="unix/linux" /><category term="cli" /><summary type="html">Dulu Sebelum adanya GUI cara kita berinteraksi dengan komputer menggunakan CLI yaitu mengetik baris perintah pada sebuah antarmuka dalam bentuk baris teks seperti 👇, namun saat ini penggunaan CLI juga masih sering digunakan khususnya dikalangan para developer.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://harpi.ch/apa-itu-shell/shell_evolution.png" /><media:content medium="image" url="https://harpi.ch/apa-itu-shell/shell_evolution.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How this site was born</title><link href="https://harpi.ch/how-this-site-was-made/" rel="alternate" type="text/html" title="How this site was born" /><published>2018-09-28T09:45:47+07:00</published><updated>2018-09-28T09:45:47+07:00</updated><id>https://harpi.ch/how-this-site-was-made</id><content type="html" xml:base="https://harpi.ch/how-this-site-was-made/">&lt;p&gt;The website was made using Jekyll the one of open source static sites generator, and using my own simple theme, I called &lt;a href=&quot;https://github.com/piharpi/jekyll-klise&quot;&gt;klisé&lt;/a&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;All the services are free, source code the site was placed on my &lt;a href=&quot;https://github.com/piharpi&quot;&gt;github&lt;/a&gt; repository privately and intergration with &lt;del&gt;&lt;a href=&quot;https://netlify.com&quot;&gt;netlify&lt;/a&gt;&lt;/del&gt; service, another service that you can use is &lt;a href=&quot;https://pages.github.com/&quot;&gt;github page&lt;/a&gt; and &lt;a href=&quot;http://now.sh&quot;&gt;vercel&lt;/a&gt; for hosting your own static site.&lt;/p&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;lets-do-this&quot;&gt;Let’s do this&lt;/h4&gt;

&lt;p&gt;So, before we begin creating a site, you need some tools, you can self paced for how to installing each tools, on this guide i’m just want to show you how to install jekyll and deploying in netlify, but make sure you have each tools below.&lt;/p&gt;

&lt;h4 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h4&gt;

&lt;p&gt;Requirements before we doing magic show.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.ruby-lang.org/en/downloads/&quot;&gt;Ruby&lt;/a&gt; programming language&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://git-scm.com&quot;&gt;Git&lt;/a&gt; (version control)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://netlify.com&quot;&gt;Netlify&lt;/a&gt; and &lt;a href=&quot;https://github.com&quot;&gt;Github&lt;/a&gt; account&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://bundler.io&quot;&gt;Bundler&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;installation&quot;&gt;Installation&lt;/h4&gt;

&lt;p&gt;First, you need some &lt;a href=&quot;https://www.staticgen.com/&quot;&gt;SSG&lt;/a&gt;, there are many kind ssg, but in case i’m using Jekyll cause i’m already familiar with it, open your terminal and type command on below&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;bundle &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;jekyll &lt;span class=&quot;c&quot;&gt;# installing jekyll in your machine&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;jekyll new my-site &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;my-site &lt;span class=&quot;c&quot;&gt;# create new jekyll project&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;jekyll s &lt;span class=&quot;c&quot;&gt;# run jekyll server&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, jekyll is running on your local machine, open your browser and go to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;localhost:4000&lt;/code&gt; is default address from jekyll, press &lt;kbd&gt;CTRL&lt;/kbd&gt; + &lt;kbd&gt;C&lt;/kbd&gt; to stop the jekyll server.&lt;/p&gt;

&lt;h4 id=&quot;adding-remote-repository&quot;&gt;Adding remote repository&lt;/h4&gt;

&lt;p&gt;Before we adding remote repository, you must have &lt;a href=&quot;https://github.com/new&quot;&gt;github&lt;/a&gt; repository, if already have repository, just add github remote address to your local folder, with the following commands&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git init &lt;span class=&quot;c&quot;&gt;# initializing project folder&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git remote add origin https://github.com/YOUR-USERNAME/YOUR-REPO.git &lt;span class=&quot;c&quot;&gt;# change UPPERCASE with your own!&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git add &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Initialize&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git push &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; origin master &lt;span class=&quot;c&quot;&gt;# push code to github&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now check your github repository, make sure the files is uploaded correctly.&lt;/p&gt;

&lt;h4 id=&quot;deploying-to-netlify&quot;&gt;Deploying to netlify&lt;/h4&gt;

&lt;p&gt;Go &lt;a href=&quot;https://netlify.com&quot;&gt;netlify&lt;/a&gt; dashboard, and following this step.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;click &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;new site from git&lt;/code&gt;, then choose &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Github&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;then choose your repository where is the jekyll sources uploaded.&lt;/li&gt;
  &lt;li&gt;netlify smart enough to configuring, we just need’s to click &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Deploy site button&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Wait for moment, and voila..! your site’s are hosting and using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.netlify.com&lt;/code&gt; tld, if your website wants to look professional, just buy a domain from your favorite domain store. or if you the first time, I advice using namecheap.com&lt;em&gt;(isn’t sponsor)&lt;/em&gt; *based on my experienced it provides good service and have various TLDs.&lt;/p&gt;

&lt;p&gt;So, what you waiting for, just create your own website for free.&lt;/p&gt;</content><author><name>Ch. Harpi</name><email>id.harpi@pm.me</email></author><category term="blog" /><category term="jamstack" /><category term="jekyll" /><category term="github" /><summary type="html">The website was made using Jekyll the one of open source static sites generator, and using my own simple theme, I called klisé.</summary></entry></feed>