Skip to content

Instantly share code, notes, and snippets.

Avatar
nggueeeng.....

Fadhil Riyanto fadhil-riyanto

nggueeeng.....
View GitHub Profile
@fadhil-riyanto
fadhil-riyanto / encode_decode.php
Created May 14, 2021 — forked from LogIN-/encode_decode.php
PHP custom encode decode functions
View encode_decode.php
<?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++;
View rampingteks.js
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' + " "; }
View rampingkan_text.php
<?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 = ",";
View check base64 with php.php
<?php
//example data
$data = "hmhmh";
if ( base64_encode(base64_decode($data, true)) === $data){
echo $data . ' itu valid';
} else {
echo $data . ' itu tidak valid';
}
//end :)
View bad_words.php
<?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;
View app.js
let mysql = require('mysql');
var db = mysql.createConnection({
host: 'localhost',
user: 'root',
password: 'root',
database: 'phpdasar'
});
db.connect(function(err){
if(err) throw err;
View calc_cli.cpp
#include <iostream>
using namespace std;
int main(){
float a, b, res;
char choice, ch;
do
{
cout<<"1.Addition\n";
View php dns scan
<!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 Oct 15, 2020
This simply calculator CLI with golang languange programming
View calc.go
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: ")