All gists

Last active 3 months ago

Finds the endpoint/server URL of any GDPS easily

0 0 1
1 import re # Required by the function
2 import os # Required by the interface
3
4 def find_gdps_endpoint(data: bytes): # Input data should be the bytes of the whole binary file !
5 # DO NOT REMOVE THE FOLLOWING COMMENT
6 # THIS FUNCTION IS COPYRIGHTED UNDER MIT LICENSE BY HGSTYLE 2023-end of the time
7 # READ THE LICENSE AT: https://hgstyle.mit-license.org/
8 # Get the URLs using a regex that I copy-pasted from Stack Overflow
9 result = re.findall(r"\w+://\w+\.\w+\.\w+/?[\w\.\?=#]*".encode(), data)
10 # Set the domains to exclude
Last active 3 months ago

Bookmarklet utility to copy the shortest version of a link without using external services

0 0 1
1 javascript:(function(){var t,o,a=window.location.hostname,i=a.split(".").pop();a.includes("amazon")?(t=window.location.href.match(/https:\/\/(?:www\.)?([a-zA-Z0-9-]+)\.amazon\.[a-zA-Z]{2,}\/.*\/dp\/([A-Z0-9]{10})/))&&(o=`https://${t[1]||"www"}.amazon.${i}/dp/${t[2]}`):a.includes("ebay")?(t=window.location.href.match(/https:\/\/(?:www\.)?ebay\.[a-zA-Z]{2,}\/itm\/(\d+)/))&&(o=`https://www.ebay.${i}/itm/${t[1]}`):a.includes("cdiscount")&&(t=window.location.href.match(/https:\/\/(?:www\.)?cdiscount\.[a-zA-Z]{2,}\/.*\/f-(\d+)-([a-zA-Z0-9]+)\.html/))&&(o=`https://www.cdiscount.com/f-${t[1]}-${t[2]}.html`),o?navigator.clipboard.writeText(o).then((()=>{alert(`The following link has been copied into your clipboard:\n${o}`)})).catch((()=>{alert("Please click the document and then click the bookmarklet!")})):alert("This service is not yet supported on this domain: "+a)})();
Last active 3 months ago

If JavaScript doesn't suck, then try to tell what will this program output. (you can do anything you want like beautifying it but you can't run it)

0 0 1
1 (()=>{let _;for(let i=0;i<10;(($)=>{})(i-1)){(($)=>{_=[Array(i)].map((_)=>{_.length+(+typeof undefined)})+($+parseInt($.toString()+(true/10)))+(typeof NaN+!$)+(typeof(null&""))+(_*-i||_)+$+[]+{}+!i+([i.toString()].map(parseInt))+(--i)+(i++)+i})(i++)/parseInt.length+parseInt.toString()};console.log((_+0*Infinity).replace(/\[/,_+[]));})();