Monday, August 19, 2019

Code Generation via “curl --libcurl”

Guillaume Valadon:

The curl --libcurl option generates a C file that mimics the used command line! #awesome

I’m a fan of this pattern. Some other examples:

Update (2019-08-20): Michael Tofias:

I don’t use it often these days, but one of things that made me fall in love with Stata was being able to copy the code generated by using the GUI. Super helpful when building graphs and such with non-intuitive APIs.

6 Comments RSS · Twitter

A fairly trivial but still frequently useful is Keyboard Maestro’s trigger by script, which provides the code to trigger the macro via AppleScript in a variety of different languages.

We like this pattern too! Selecting something you already have and then running a command which gives you the code to create whatever you've selected makes automation a lot easier. OmniGraffle offers both Edit > Copy As > JavaScript and Edit > Copy As > AppleScript, while OmniFocus offers Edit > Copy as TaskPaper.

Paw does this for network requests, too. https://paw.cloud/

Juande Santander-Vela

The old Macro Recorder (System 6) was another example, as it is the Apple Script recorder, but it used to give better results than nowadays.

In JIRA reports, you get links to the query that will provide you the relevant number of issues.

One of my side projects was a plugin for Adobe Illustrator that would export Quartz code. http://samesimilar.com/ai2cg.html

DevTools of Safari/Chrome/Firefox also copy as cURL, see: https://jvns.ca/images/curl.jpeg

Leave a Comment