LuisAFK

LuisAFK

0-day streak
Working on tsre, a JavaScript and TypeScript reverse engineering tool. It uses Putout to parse the JavaScript, and then feeds it bit by bit into AI to guess identifier names automatically! Currently, it is able to turn this:
function y(b){return(b-32)*5/9}function z(b){return b*9/5+32}function A(b){return b-273.15}function B(b){return b+273.15}for await(let b of console){if(!b||b==="exit")break;const[,q,w,x]=b.match(/(\d+(?:\.\d+)?)\s*([fkc])\s*(?:in|to)\s*([fkc])/i)||[];if(!q||!w||!x){console.log("Invalid input");continue}const j=parseFloat(q);let g;switch(w.toLowerCase()+x.toLowerCase()){case"fc":g=y(j);break;case"cf":g=z(j);break;case"kc":g=A(j);break;case"ck":g=B(j);break;default:console.log("Invalid conversion");continue}console.log(g)}
Into this:

function convertFahrenheitToCelsius(fahrenheitTemperature) {
  return ((fahrenheitTemperature - 32) * 5) / 9;
}

function convertCelsiusToFahrenheit(celsiusTemperature) {
  return (celsiusTemperature * 9) / 5 + 32;
}

function convertKelvinToCelsius(kelvinTemperature) {
  return kelvinTemperature - 273.15;
}

function convertCelsiusToKelvin(celsiusTemperature) {
  return celsiusTemperature + 273.15;
}

for await (let consoleLogEntries of console) {
  if (!consoleLogEntries || consoleLogEntries === "exit") break;

  const [, temperatureValue, matchedTemperatureValue, matchedTemperature] =
    consoleLogEntries.match(
      /(\d+(?:\.\d+)?)\s*([fkc])\s*(?:in|to)\s*([fkc])/i,
    ) || [];

  if (!temperatureValue || !matchedTemperatureValue || !matchedTemperature) {
    console.log("Invalid input");
    continue;
  }

  const parsedTemperature = parseFloat(temperatureValue);
  let g;

  switch (
    matchedTemperatureValue.toLowerCase() + matchedTemperature.toLowerCase()
  ) {
    case "fc":
      g = convertFahrenheitToCelsius(parsedTemperature);
      break;

    case "cf":
      g = convertCelsiusToFahrenheit(parsedTemperature);
      break;

    case "kc":
      g = convertKelvinToCelsius(parsedTemperature);
      break;

    case "ck":
      g = convertCelsiusToKelvin(parsedTemperature);
      break;

    default:
      console.log("Invalid conversion");
      continue;
  }

  console.log(g);
}
https://imgutil.s3.us-east-2.amazonaws.com/135434332e2d0cf433bb2cbf0dd8901ab6d8543a0c1b6f63498fd2ad5e6d5e0c/9fdc25ff-8ec7-4ee8-ac70-e7add45ac7ce.png
typescript emoji
github emoji
summer-of-making emoji
js emoji
A while back I started working on ReplCraft, a Minecraft Fabric mod that lets users programmatically interact with your Minecraft world. It's a rewrite of LeeFlemingRepl/replcraft, which is a Spigot/Paper plugin, so that it can be used in the new ReplMC 1.21 Fabric server. It's still a work-in-progress though.
https://imgutil.s3.us-east-2.amazonaws.com/d73a4e57d8fda2a944b29b424d12c02ffdf8b77f589ec99b4fdb4465c1633289/bc2e7c7b-0cd3-4eb3-980e-9cbf6b210138.png
github emoji
summer-of-making emoji
minecraft emoji
I've made an API client for the Air France in-flight connectivity API! I made it because I wanted to code something offline while on a flight, and when I connected to the plane WiFi and inspected their captive portal, I thought the API looked pretty cool and provided a lot of information. So I made this API client. You can use it to fetch information about your current flight, connecting flights, flight trajectory, internet coverage, services health, connectivity status, and more. Although obviously it only works while you're in an Air France flight and connected to their AirFranceCONNECT WiFi network. Source code at github.com/lafkpages/air-france-api
https://imgutil.s3.us-east-2.amazonaws.com/3bb428d7ca7299536c9b1b17fa11d060c7bf200488fe7aafe9253e89adf9379a/7de724e4-f2a0-4480-a299-5fa972190e46.png
I've made a simple utility plugin for DesModder that helps quickly generate shapes and their equations in Desmos. It currently only supports rotatable ellipses and rectangles, but I'll be adding more soon. The idea for this plugin came to me while trying to do some art in Desmos. I needed to add some shapes on top of an image I had for reference. This plugin would save me from having to write the equations for different shapes out by hand, substitute variables to more easily tweak them, and then substitute in the actual values once I'm done. The PR hasn't been merged yet, so the only way to try the plugin is to setup a dev version of DesModder and checkout the branch for my plugin. Once the PR gets merged, the plugin should be available on the next DesModder release.
https://imgutil.s3.us-east-2.amazonaws.com/3266f50ee787732c28623d4688ca2cba849c188c319fb9d2d3bf50c5e1300aea/59070a7a-48fe-4317-af18-39166166781b.png
I've made multibun, a sort-of version manager for Bun. I say sort-of because while it can perfectly be used as a version manager, allowing you to download several versions and easily switch between them, its main use case, and what I designed it for, is to run scripts against several versions of Bun easily. This could be used for extensively testing your library to ensure it works on several versions, or to test in what versions a bug in Bun itself occurs. I had initially made this for testing bun-decompile against all versions to ensure full compatibility, but then decided to publish it separately. It can generate reports for version runs in several formats, including CSV, HTML, and more. An example HTML report for bun-decompile can be found here.
https://imgutil.s3.us-east-2.amazonaws.com/9d6f919cc5589d4d3210bc758f6902b4bb237d1e2db350cf48fdaef82d3c9b25/e9769daa-69a8-40dd-bf13-f5f6be69344b.png
There was a bug in the bun-decompile webapp, where I had forgotten to release a new version of a library it depended on but it worked locally because I had linked the dependency. So now the webapp works, and I've also improved the tests! You can try it at bun-decompile.surge.sh Source code on GitHub
https://imgutil.s3.us-east-2.amazonaws.com/b94e5c8d5009ae68c1c6e60ae8254f9b37a68002075345951fac128099bbe3cb/bc5dea7c-291e-4f27-bfa7-1fadcdd5ae87.png
Made an extension for Raycast a while back for viewing and searching for Minecraft crafting recipes. You can find the extension here, and its source code here. To make this extension, I also had to make a library for scraping the recipes from minecraftcrafting.info. The package is published on NPM, and the source code is on GitHub.
https://imgutil.s3.us-east-2.amazonaws.com/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/4e20e41c-5acc-4b31-ad5c-0e20f6b8c6b6.png
npm emoji
minecraft emoji
goose-honk-technologist emoji
github emoji
summer-of-making emoji
https://scrapbook-into-the-redwoods.s3.amazonaws.com/5a0c323c-ef7c-49ab-93b5-c01408e3ecb1-whatsapp-pa-hangman.jpeghttps://imgutil.s3.us-east-2.amazonaws.com/83cc1413276aac358f21022de72212aa3ff34430a88798e8ef1b7ab0451f692f/1b199a45-a160-49ef-8737-5e25e86460e9.png
github emoji
summer-of-making emoji
I've added Google OAuth to WhatsApp PA! Plugins can request access with certain scopes and use Google APIs, and all the complex scope and token management and refreshing is handled by WhatsApp PA for you. I've started working on a Google Calendar plugin using this as well, that can help you track your events and even get reminders for your events directly in WhatsApp. github.com/lafkpages/whatsapp-pa
https://imgutil.s3.us-east-2.amazonaws.com/630de537828c81f853486f6f7472ecd932aa19a377505e68cfee5cbcd6a2cd32/b41e603d-36d5-403b-b5f3-bea71178b5dc.png
summer-of-making emoji
google emoji
github emoji
https://imgutil.s3.us-east-2.amazonaws.com/5bafc25d743352a89a3d6b62c7c601a0793a6e9727d29f6938b758fad3ff1aaf/b9c40a3c-be7c-47f3-8aa4-f2ee4a094253.png
I've made WhatsApp PA, a customisable, extendable, and powerful multi-purpose WhatsApp bot, built using Bun and whatsapp-web.js. It has a couple of built-in plugins, but you can also write your own. It's still a work-in-progress, but it's in a pretty usable state now. Source code: github.com/lafkpages/whatsapp-pa Maybe in the future I will make my instance public and share the phone number, so people can message it without having to host their own instance, but I still need to work on some stuff first before I can do that.
https://imgutil.s3.us-east-2.amazonaws.com/c3a86642ea086449ab966ed06833958da85c0c76cf86aebbf3eb43411f34a306/8c5e55be-265b-4d7b-9243-c663dfa6d55a.png
I've updated bun-decompile to work with older and newer versions of Bun. With executables generated with --sourcemap in Bun >= 1.1.22, the sourcemaps can now be extracted. Also improved some compatibility issues, slightly improved the web app UI, fully automated all unit testing with all supported versions of Bun (>= 0.6.0) on GitHub actions using multibun, and made the results of the unit tests available directly on the web app. Repo: github.com/lafkpages/bun-decompile Web app: bun-decompile.surge.sh
https://imgutil.s3.us-east-2.amazonaws.com/6c7fdeed312da3c2bfd9673d4ab07ed736c7fec839e08b67fb5f9881628fe87c/494d2636-9b1f-41a2-9b33-cef8a9b9275e.png
github emoji
summer-of-making emoji
#arcade Today I finished a project I've been working on for a few days. It can extract JavaScript sources from an executable file generated via bun build --compile. I've learned a bit of Zig along the way, while having to read and modify Bun's source code to figure out how stuff worked. You can try it at bun-decompile.surge.sh Source code: github.com/lafkpages/bun-decompile (Repost because I forgot to add a screenshot and scrappy broke or something)
https://scrapbook-into-the-redwoods.s3.amazonaws.com/f5977575-ecf9-43f3-9837-8c0bf63fc641-image.png