Skip to content

Instantly share code, notes, and snippets.

View fannyhasbi's full-sized avatar

Fanny Hasbi fannyhasbi

View GitHub Profile
@fannyhasbi
fannyhasbi / axios-catch-error.js
Created June 30, 2020 12:31 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@fannyhasbi
fannyhasbi / benchmark-commands.md
Created September 8, 2019 19:25 — forked from ueokande/benchmark-commands.md
Kafka Benchmark Commands

Benchmark commands

Producer

Setup

bin/kafka-topics.sh \
  --zookeeper zookeeper.example.com:2181 \
  --create \
@fannyhasbi
fannyhasbi / kafka-docker.sh
Created August 26, 2019 10:12
Docker commands to run Kafka using ches/kafka
# Author : Fanny Hasbi
# Web : fannyhasbi.id
# Reference : https://medium.com/rahasak/kafka-and-zookeeper-with-docker-65cff2c2c34f#d972
# Run Zookeper
docker run -d \
--name zookeeper \
-p 2181:2181 \
jplock/zookeeper
@fannyhasbi
fannyhasbi / proto.msg
Created July 25, 2019 02:20 — forked from alexeypegov/proto.msg
ProtoBuffers debug with CURL. ProtoBuffers should be installed first: "yum install protobuf" or "brew install protobuf".
key:"string value"
int_key:22
@fannyhasbi
fannyhasbi / show.php
Last active January 23, 2019 13:08
Force show empty value of a table
<?php
$conn = mysqli_connect("localhost", "root", "", "test") or die(mysql_error());
function check_len($arr, $index, $key){
if(array_key_exists($index, $arr)){
return $arr[$index][$key];
}
return "";
}
@fannyhasbi
fannyhasbi / index.html
Last active October 27, 2018 02:40
Vue root index
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Modul PWA</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="shortcut icon" href="icon/192.ico" type="image/x-icon" />
<link rel="icon" href="https://upload.wikimedia.org/wikipedia/commons/f/f2/Lambang_Kota_Semarang.png" sizes="32x32" />
@fannyhasbi
fannyhasbi / app.js
Last active October 27, 2018 02:40
Vue instance for PWA
new Vue({
el:'#app',
data:{
kodepos : [],search : '', awal:0,akhir:10,halaman:1,tampil:true
},
created(){
this.getData();
console.log(this.awal)
},
methods:{
@fannyhasbi
fannyhasbi / uts_rpl.md
Created October 4, 2018 04:34
Persiapan UTS Rekayasa Perangkat Lunak 2018

Persiapan UTS Rekayasa Perangkat Lunak 2018

Introduction

Definisi

Rekaya perangkat lunak adalah bidang rekayasa yang berkaitan dengan semua aspek produksi perangkat lunak dari tahap awal spesifikasi sistem sampai pemeliharaan sistem setelah itu telah mulai digunakan.

Kebutuhan

  • Menggerakkan pengambilan keputusan bisnis
  • Dasar penyelidikan ilmiah modern
  • Rekayasa pemecah masalah
@fannyhasbi
fannyhasbi / uts_progjar.md
Last active October 1, 2018 17:59
Rangkuman persiapan UTS Pemrograman Jaringan 2018

Belajar UTS Pemrograman Jaringan

Definisi jaringan komputer

Jaringan komputer adalah sekumpulan komputer yang saling berkomunikasi melalui media jaringan secara bersama-sama untuk tujuan pertukaran data dan peralatan

Three-way Handshaking adalah suatu proses otomatis yang terjadi ketika komputer berkomunikasi dengan perangkat asing untuk menetapkan peraturan untuk berkomunikasi.

  1. -> Synchronize
  2. <- Synchronize-Acknowledge
  3. -> Acknowledge
@fannyhasbi
fannyhasbi / detail.php
Created September 27, 2018 12:19
Halaman detail mengambil nilai id dari url dengan $_GET['id']
<?php
require_once "./koneksi.php";
$sql = "SELECT * FROM buku WHERE id_buku = ". $_GET['id'];
$query = mysqli_query($connect, $sql);
$buku = mysqli_fetch_assoc($query);
?>
<!DOCTYPE html>
<html>
<head>