On my MacBook, I’m using Hammerspoon and it’s great too, plus you can write your scripts in Lua which significantly eases the learning curve (assuming that you already know Lua, of course)
I like AppleScript on macOS, it’s built in and easy to use, once you grok its odd syntax. I’m not very familiar with AHK, but AppleScripts work with actual application-provided APIs and object models. You can use JSX (JavaScript for Automation) these days too, with all the same APIs. For example, these two are equivalent:
AppleScript:
tell application “Safari” to close current tab of front window
Where “current tab” is an application-defined property of Safari’s windows.
Script Editor.app supports both languages and has built in docs for both native and third party apps (via File > Open Dictionary…), including the AHK style “System Events” pseudo-app. Plenty of third party apps provide AppleScript interfaces, e.g. iTerm2 has plenty of stuff for manipulating windows, tabs, and splits. Capture One has a truly massive amount of operations from applying image adjustments like contrast and saturation, to querying and controlling tethered cameras.
Aside from running in Script Editor, there are several options for launching AppleScripts:
Automator.app lets you make Quick Actions that run AppleScripts (among other things), which can be assigned to the context menu or hotkeys.
Script Editor can save AppleScripts as app bundles (e.g. YourScript.app) that you can launch as usual from Finder, the Dock, or Spotlight.
AppleScript also has access to GUI widgets like file pickers and dialogs, so you could easily write e.g. an AppleScript mini-application that prompts for image files and batch resizes them all to a particular size with the “Image Events” pseudo-app.
xdotool mentioned. There’s dbus, which can be explored conveniently with qdbusviewer. I’ve learned there’s also a QT debugger program, which looks to be a great deal more low-level and doubtless has more access to otherwise unexposed Qt signal slots, but I’ve only glanced at its capabilities once briefly.
Cakelisp doesn’t contain any patented or extremely special code, plus it’s open source. The case against CoPilot in this case is not that strong IMO.
If you want to self-host your repo, go ahead. But don’t make it a case against CoPilot just because some (probably trivial) code can be sent to Microsoft
I can’t speak for the author, but I don’t think the concern is “oh no, copilot will use this specific code in ways I don’t like”; it’s more “microsoft has shown a consistent non-stop refusal to even try to understand the concept of consent, and by using their products, I appear to be endorsing or at least tolerating their behavior”.
Cakelisp is GPLv3. Microsoft is violating its copyright. “It’s open source” does not mean you can do anything with it, you need to follow the license. I would say the case against Copilot is extremely strong.
Software Freedom Conservancy published why Copilot is problematic in its Give Up GitHub! campaign.
It’s a good article. The one thing that bugs me is the use of useCallback when it’s not necessary (in the first example, where none of the setter functions are getting passed on to children).
The folks on Chromium’s bugtracker will likely mark it for triage and then ignore it for the next few years (the scars still hurt), but it’s basically here - https://bugs.chromium.org/p/chromium/issues/list
Off topic: take a moment and appreciate the awesome parallax and music/3D interactions that exist in this blog. Drag the logo or hit the play button- it’s incredible.
ok wow (need to enable some stuff in umatrix, including web workers) but that’s nice.
Generally also the pictures for the different Fires are pretty nice.
Moment.js is a much nicer experience in general when dealing with time and dates, and has many saner defaults and helper functions, although it’s ultimately backed by the native date object so it doesn’t paper over everything perfectly.
I’ve found https://js-joda.github.io/js-joda/ to be a really robust library for more complex date time stuff, it is especially easier to reason about and manipulate date times with time zone offsets. It’s a port of a java library and the api reflects this and is quite clunky, but it’s also using its own immutable representation instead of the native date.
I regretted going with moment.js for an angular app. It is HUGE and isn’t really easy to reduce size. I shouldn’t have to do some fancy build steps to do it.
Doesn’t seem like something that would only be possible on one platform. Or did you mean that it’s not a style that’s likely to be desired outside of Windows?
Well, Alacritty tries to be as platform-agnostic as possible - and adding acrylic transparency/opacity means that there needs to be specific handling for it in certain operating systems. You can enable it on Linux using a compositor, but Windows (and I’m pretty sure Mac as well) is a different story
The example given is quite extreme. Overall, I think verbosity isn’t necessarily a bad thing (look at vim for example).
Also, if you’re into comments - just give an example of the input and output of such a Regular Expression. It would do most of the job, and if the reader knows just a bit of regex, they could figure it out, either by themselves or by using tools like regexr and regex101.
People I know (and a lot more people I don’t know) are using TechPicks (Disclaimer: I’m the author and the maintainer of TechPicks).
It’s a Telegram channel that curates techonlogy and programming-related news on a daily basis from all sorts of sources, with over 1.5k subscribers.
I just joined your channel and also I just saw one of my post was shared with your subscribers.
Seeing this really encourages me to more interesting blog posts
Thanks for joining! It’s great to hear that :)
I only add what I consider as quality content, so it makes sense. Thank you for your contribution!
Well thank you.
I got one question for you
How were you able to build that following for your channel
Basically by telling people about it when a relevant discussion arose, such as this thread for example
Nice! Reminds me of my own AHK script collection - https://github.com/tkore/autohotkey-scripts/blob/main/script.ahk
I’ve heard good things about AHK. Is there anything similar for macOS or Linux?
AHK is awesome, I’ve been using it for years.
On my MacBook, I’m using Hammerspoon and it’s great too, plus you can write your scripts in Lua which significantly eases the learning curve (assuming that you already know Lua, of course)
I like AppleScript on macOS, it’s built in and easy to use, once you grok its odd syntax. I’m not very familiar with AHK, but AppleScripts work with actual application-provided APIs and object models. You can use JSX (JavaScript for Automation) these days too, with all the same APIs. For example, these two are equivalent:
AppleScript:
JSX:
Where “current tab” is an application-defined property of Safari’s windows.
Script Editor.app
supports both languages and has built in docs for both native and third party apps (via File > Open Dictionary…), including the AHK style “System Events” pseudo-app. Plenty of third party apps provide AppleScript interfaces, e.g. iTerm2 has plenty of stuff for manipulating windows, tabs, and splits. Capture One has a truly massive amount of operations from applying image adjustments like contrast and saturation, to querying and controlling tethered cameras.Aside from running in Script Editor, there are several options for launching AppleScripts:
osascript
. For example, this zsh function and accompanying AppleScript to send files to the Trash.Automator.app
lets you make Quick Actions that run AppleScripts (among other things), which can be assigned to the context menu or hotkeys.AppleScript also has access to GUI widgets like file pickers and dialogs, so you could easily write e.g. an AppleScript mini-application that prompts for image files and batch resizes them all to a particular size with the “Image Events” pseudo-app.
Having never used ahk, xdotool fits my needs for occasional stupid gui hacks.
If I actually used ahk I’m sure I’d find ahk amazingly superior. I can’t do any of the magic things that ahk does without a lot of work.
Is there an xdotool equivalent for wayland?
I guess this thing exists https://github.com/ReimuNotMoe/ydotool
I’ve used espanso, but it’s not a one-to-one match in functionality, but easy to configure.
xdotool
mentioned. There’sdbus
, which can be explored conveniently withqdbusviewer
. I’ve learned there’s also a QT debugger program, which looks to be a great deal more low-level and doubtless has more access to otherwise unexposed Qt signal slots, but I’ve only glanced at its capabilities once briefly.Cakelisp doesn’t contain any patented or extremely special code, plus it’s open source. The case against CoPilot in this case is not that strong IMO.
If you want to self-host your repo, go ahead. But don’t make it a case against CoPilot just because some (probably trivial) code can be sent to Microsoft
I can’t speak for the author, but I don’t think the concern is “oh no, copilot will use this specific code in ways I don’t like”; it’s more “microsoft has shown a consistent non-stop refusal to even try to understand the concept of consent, and by using their products, I appear to be endorsing or at least tolerating their behavior”.
And still, it’s a drop in the ocean. It would probably do more harm than good to Cakelisp
Each one drops the idea in someone else’s mind, until there’s a whole wave.
I moved my lisp compiler off Github over a year ago and I have zero regrets. The community is thriving.
Monopolies are bad.
Cakelisp is GPLv3. Microsoft is violating its copyright. “It’s open source” does not mean you can do anything with it, you need to follow the license. I would say the case against Copilot is extremely strong.
Software Freedom Conservancy published why Copilot is problematic in its Give Up GitHub! campaign.
It’s a good article. The one thing that bugs me is the use of useCallback when it’s not necessary (in the first example, where none of the setter functions are getting passed on to children).
Memoization always comes with a cost.
The folks on Chromium’s bugtracker will likely mark it for triage and then ignore it for the next few years (the scars still hurt), but it’s basically here - https://bugs.chromium.org/p/chromium/issues/list
Off topic: take a moment and appreciate the awesome parallax and music/3D interactions that exist in this blog. Drag the logo or hit the play button- it’s incredible.
ok wow (need to enable some stuff in umatrix, including web workers) but that’s nice. Generally also the pictures for the different Fires are pretty nice.
Just recently I’ve added a CI test to check if our bundle size is bigger than 5mb.
Oops.
Moment.js is a much nicer experience in general when dealing with time and dates, and has many saner defaults and helper functions, although it’s ultimately backed by the native date object so it doesn’t paper over everything perfectly.
I’ve found https://js-joda.github.io/js-joda/ to be a really robust library for more complex date time stuff, it is especially easier to reason about and manipulate date times with time zone offsets. It’s a port of a java library and the api reflects this and is quite clunky, but it’s also using its own immutable representation instead of the native date.
I’d recommend going with date-fns instead of Moment.js, for reasons like immutability, tree-shaking and performance.
I regretted going with moment.js for an angular app. It is HUGE and isn’t really easy to reduce size. I shouldn’t have to do some fancy build steps to do it.
That’s fair I use it on the backend mostly less of an issue there
Yeah, I wouldn’t mind that on the backend.
My favorite terminal emulator. I just wish acrylic transparency gets in there, but unfortunately it’s too platform-specific :(
What is acrylic transparency?
Basically this (not my screenshot)
https://user-images.githubusercontent.com/2313018/73467282-699e9a00-4383-11ea-9871-5c3ac6d29afe.png
Ahh right.
Doesn’t seem like something that would only be possible on one platform. Or did you mean that it’s not a style that’s likely to be desired outside of Windows?
Well, Alacritty tries to be as platform-agnostic as possible - and adding acrylic transparency/opacity means that there needs to be specific handling for it in certain operating systems. You can enable it on Linux using a compositor, but Windows (and I’m pretty sure Mac as well) is a different story
https://github.com/alacritty/alacritty/pull/3537#pullrequestreview-384074016
The example given is quite extreme. Overall, I think verbosity isn’t necessarily a bad thing (look at vim for example).
Also, if you’re into comments - just give an example of the input and output of such a Regular Expression. It would do most of the job, and if the reader knows just a bit of regex, they could figure it out, either by themselves or by using tools like regexr and regex101.
+1 for regex101, their test functions and also storage for your tests, so you can embed that as comment
That might be a bad idea if you want your code to last longer than Regex101. Probably okay if it’s purely supplemental to your actual comment, though.
true, but it’s just additional, with an easy way to verify & create it