Skip to content

Instantly share code, notes, and snippets.

@erhaem
erhaem / aes.js
Last active February 6, 2019 12:21
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
var CryptoJS=CryptoJS||function(c,t){var e={},r=e.lib={},i=function(){},n=r.Base={extend:function(t){i.prototype=this;var e=new i;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments)}),(e.init.prototype=e).$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=r.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||s).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes;if(t=t.sigBytes,this.clamp(),i%4)for(var n=0;n<t;n++)e[i+n>>>2]|=(r[n>>>2]>>>24-n%4*8&255)<<24-(i+n)%4*8;else if(65535<r.leng
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
var CryptoJS=CryptoJS||function(c,t){var e={},r=e.lib={},i=function(){},n=r.Base={extend:function(t){i.prototype=this;var e=new i;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments)}),(e.init.prototype=e).$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=r.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||o).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes;if(t=t.sigBytes,this.clamp(),i%4)for(var n=0;n<t;n++)e[i+n>>>2]|=(r[n>>>2]>>>24-n%4*8&255)<<24-(i+n)%4*8;else if(65535<r.leng
@erhaem
erhaem / anti_page-splitting.js
Last active August 7, 2023 06:10
Tired of shitty Indonesian News sites' page-splitting? This tool allows you to deal with it by redirecting you to the entire content page. You may use this tool with Greasemonkey or alike, or even putting it on bookmark bar (Bookmarklet) by putting "javascript:" before the whole script.
/**
* Indonesian News Sites' Page-splitting Deterrent Tool
* @author Rifqi Haidar
*/
(function () {
const averageParam = "?page=all";
// pattern: { domainName: endpoint??params }
const sites = {
"detik.com": "?single=1",
@erhaem
erhaem / fb_view-full-size_image_bookmarklet.js
Last active August 16, 2023 13:02
Facebook Tool: View Full Size Image. Copy the bookmarklet version, paste it on the bookmark bar; then click it.
javascript:(function(a){var b=new URL(a.location);0>b.hostname.indexOf("facebook.com")?alert("Only works on Facebook's domains"):"/photo.php"!==b.pathname?alert("Only works at *.facebook.com/photo.php"):(b=b.searchParams.get("fbid"))?a.location.replace("https://m.facebook.com/photo/view_full_size/?fbid="+b):alert("`fbid` not found")})(window)
@erhaem
erhaem / settings.json
Created August 30, 2023 09:33
my vscode (vscodium btw) settings
{
"workbench.editor.showTabs": false,
"workbench.colorTheme": "One Dark Pro Flat",
"workbench.colorCustomizations": {
"[One Dark Pro Flat]": {
"tab.activeBackground": "#282c34",
"activityBar.background": "#282c34",
"sideBar.background": "#282c34",
"tab.activeBorder": "#282c34",
"sideBar.border": "#282c34"
@erhaem
erhaem / bypass_login_tplink_10_attempts.js
Last active December 6, 2023 10:58
Bypass Login TPLink Router: "You have exceeded ten attempts."
@erhaem
erhaem / ftp.php
Last active December 11, 2023 07:08
FTP File Upload
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FTP File Upload</title>
</head>
<body>
<h2>File Upload via FTP</h2>
<form action="" method="post" enctype="multipart/form-data">
@erhaem
erhaem / combine-splitted-zip.php
Created December 11, 2023 08:03
Used when `upload_max_filesize = 1M`. lmao
<?php
function combineAndExtract($archiveName, $outputDirectory)
{
// Combine split parts into a single ZIP file
$combinedArchivePath = combineSplitZip($archiveName);
// Extract the combined ZIP archive
extractZip($combinedArchivePath, $outputDirectory);
// Optionally, you can delete the combined ZIP file
@erhaem
erhaem / discord_token.md
Last active July 19, 2024 03:32
Get Discord Token (Bookmarklet/Js Inject)

Get Discord Token (Bookmarklet)

Usage

Copy and paste this following code onto your browser bookmark bar, then click the bookmark after.

javascript:void(function(){prompt('Here is your Discord token',(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken())})()

Credits

Props to Gilgameš for sharing the code

@erhaem
erhaem / google-doodle-paris-2024.md
Last active July 31, 2024 04:49
Google Doodle: Paris 2024 cheat

Google Doodle: Paris 2024 cheat

Sorry for messing up the fun. This script helps you spot the clickable object on Google Doodle Paris 2024 https://searchplayground.google/paris-2024.

javascript:void(function(){
const buttons = document.querySelector('spg-root')
  .shadowRoot.querySelector('bsx-gtm-tracking spg-interactive-map')
  .shadowRoot.querySelector('spg-interactive-layer')
  .shadowRoot.querySelectorAll('button[class="  "]:not([aria-pressed])');

buttons.forEach((btn) =&gt; {