Skip to content

Instantly share code, notes, and snippets.

@ahhzaky
ahhzaky / error.go
Created September 4, 2024 19:37
helper/ golang template response api
package helper
func PanicIfError(err error) {
if err != nil {
panic(err)
}
}
@ahhzaky
ahhzaky / Help Donut.c
Last active July 31, 2024 02:35
Donut math C
/* Learn Donut */
/* file: donut.c */
/* compile: gcc donut.c -o donut.exe */
/* out: 2024 */
/* Refrense:
- https://www.youtube.com/watch?v=DEqXNfs_HhY
- https://www.a1k0n.net/2011/07/20/donut-math.html
- https://gist.github.com/gcr/1075131
*/
@ahhzaky
ahhzaky / ResponseFormatter.php
Last active July 31, 2024 02:22
Laravel Response Helpers/ResponseFormatter.php
<?php
namespace App\Helpers;
/**
* Format response.
*/
class ResponseFormatter
{
/**
@ahhzaky
ahhzaky / Test js function
Created June 3, 2021 15:25
Test js function
/**
* TODO:
* 1. Buatlah fungsi bernama minimal dengan ketentuan berikut:
* - Menerima dua buah argumen number, a dan b.
* - Mengembalikan nilai terkecil antara a atau b.
* - Bila nilai keduanya sama, maka kembalikan dengan nilai a
*
* contoh:
* minimal(1, 4) // 1
* minimal(3, 2) // 2
/**
* TODO:
* 1. Buatlah variabel currency yang merupakan Map dengan kriteria:
* - key "USD", value 14000
* - key "JPY", value 131
* - key "SGD", value 11000
* - key "MYR", value 3500
* 2. Buatlah variabel priceInIDR yang bernilai dari hasil perkalian:
* - priceInJPY dengan nilai currency JPY
*/
/**
* TODO
* 1. Buatlah variabel dengan nama restaurant yang object dengan ketentuan berikut:
* - Memiliki properti bernama "name"
* - Bertipe data string
* - Bernilai apa pun, asalkan tidak string kosong atau null.
* - Memiliki properti bernama "city"
* - Bertipe data string
* - Bernilai apa pun, asalkan tidak string kosong atau null.
* - Memiliki properti "favorite drink"
@ahhzaky
ahhzaky / svm-tutorial-2.ipynb
Created December 29, 2020 06:36
svm-tutorial-2.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ahhzaky
ahhzaky / svm-tutorial-1.ipynb
Created December 29, 2020 06:36
svm-tutorial-1.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ahhzaky
ahhzaky / methodminik-means.ipynb
Created December 29, 2020 06:34
methodminik-means.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.