Skip to content

Instantly share code, notes, and snippets.

View fadhil-riyanto's full-sized avatar
🏠
Learning for JLPT

Fadhil Riyanto fadhil-riyanto

🏠
Learning for JLPT
View GitHub Profile
<?php
$host = "https://google.com";
$count = 10000
for ($a = 1; $a < $count; $a++) {
$nodes[] = $host;
}
$node_count = count($nodes);
$curl_arr = array();
$master = curl_multi_init();
@fadhil-riyanto
fadhil-riyanto / encode_decode.php
Created May 14, 2021 04:19 — forked from LogIN-/encode_decode.php
PHP custom encode decode functions
<?php
function encode($string,$key) {
$key = sha1($key);
$strLen = strlen($string);
$keyLen = strlen($key);
for ($i = 0; $i < $strLen; $i++) {
$ordStr = ord(substr($string,$i,1));
if ($j == $keyLen) { $j = 0; }
$ordKey = ord(substr($key,$j,1));
$j++;
function rampingkan_teks(string, type) {
if (type == "NEW_LINE") {
ipes = '\r\n';
} else if (type == "SPACE") {
ipes = " ";
} else if (type == "KOMA") {
ipes = ",";
} else if (type == "TITIK") {
ipes = ".";
} else if (type == "NEW_LINE_SPACE") { ipes = '\r\n' + " "; }
<?php
function rampingkan_text($string, $type)
{
//PERTAMA cek kondisi dia milih type rampingkan apanya
if($type == "NEW_LINE"){
$ipes = PHP_EOL;
}elseif($type == "SPACE"){
$ipes = " ";
}elseif($type == "KOMA"){
$ipes = ",";
<?php
//example data
$data = "hmhmh";
if ( base64_encode(base64_decode($data, true)) === $data){
echo $data . ' itu valid';
} else {
echo $data . ' itu tidak valid';
}
//end :)
<?php
$Block = array('asu','bangsat', 'njir'); // kata yang ingin diblok
$String = "asu, tadi njir, tadi ada orang bangsat !";
$String = preg_replace("/(\b|[0-9_])(".implode('|',$Block).")(\b|[0-9_])/i", '***', $String);
echo $String;
let mysql = require('mysql');
var db = mysql.createConnection({
host: 'localhost',
user: 'root',
password: 'root',
database: 'phpdasar'
});
db.connect(function(err){
if(err) throw err;
#include <iostream>
using namespace std;
int main(){
float a, b, res;
char choice, ch;
do
{
cout<<"1.Addition\n";
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>dns</title>
</head>
<body>
<form action="" method="post">
<select name="jenis_scan">
@fadhil-riyanto
fadhil-riyanto / calc.go
Created October 15, 2020 02:21
This simply calculator CLI with golang languange programming
package main
import "fmt"
func main() {
var operator string
var number1, number2 int
fmt.Print("Please enter First number: ")
fmt.Scanln(&number1)
fmt.Print("Please enter Second number: ")