Skip to content

Instantly share code, notes, and snippets.

View adzimzf's full-sized avatar

Adzim Zul Fahmi adzimzf

  • Jakarta, Indonesia
View GitHub Profile
@adzimzf
adzimzf / load_test.go
Last active December 19, 2023 06:35
A simple load testing tools, best to do a load testing for a function or chain request. It'll automatically adjust the request based on error rate
type LoadTester struct {
duration time.Duration
initialRPS int
maxErrorRate float64
maxOnGoingReq int64
rpsAdjustPeriod time.Duration
job func() error
// no need to update
@adzimzf
adzimzf / buffer1.go
Created April 15, 2021 08:00
redirect stderr & stdout to file
package main
import (
"fmt"
"log"
"os"
"syscall"
)
func main() {
package main
import (
"fmt"
"log"
"time"
"github.com/gomodule/redigo/redis"
)
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
#primary_nav_wrap
{
margin-top:15px;
margin-left:20px;
display:none;
string = ""
x = 5
bar = x
# Looping Baris
while bar >= 0:
# Looping Kolom Spasi Kosong
kol = bar
while kol > 0:
string = string + " "
<?php
//mendefinisikan operan 1 dan 2
$operand_1 = array(array(1,3,4),array(4,7,8),array(3,1,3));
$operand_2 = array(array(4,6,9),array(5,2,0),array(3,6,7));
for ($baris=0; $baris < count($operand_1); $baris++) {
for ($kolom=0; $kolom < count($operand_1); $kolom++) {
echo $operand_1[$baris][$kolom]." ";
}
echo PHP_EOL;
<?php
$a=10;
for ($i=1; $i < $a-1; $i++) {
for ($j=($a-$i); $j > 1 ; $j--) {
echo " ";
}
for ($k=1; $k < $i-1; $k++) {
echo "*";
}
for ($l=1; $l < $i-2 ; $l++) {