Skip to content

Instantly share code, notes, and snippets.

View fadhil-riyanto's full-sized avatar
:octocat:
Focus UTS, 2 minggu kedepan

Fadhil Riyanto fadhil-riyanto

:octocat:
Focus UTS, 2 minggu kedepan
View GitHub Profile
@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: ")
#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">
let mysql = require('mysql');
var db = mysql.createConnection({
host: 'localhost',
user: 'root',
password: 'root',
database: 'phpdasar'
});
db.connect(function(err){
if(err) throw err;
<?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;
<?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
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 = ",";
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' + " "; }
@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++;
<?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();