Fork me on GitHub
#clojure-europe
<
2022-01-03
>
RAMart06:01:05

Hi y'all! Hope you had a pleasant turn of the year.

Fahd El Mazouni07:01:15

Good luck going back to the battlefield !

orestis07:01:52

Good morning! Nurseries are out for another week so I'm on playground duty :)

👍 1
simongray09:01:36

Is that the Athens Acropolis in the background? :O

orestis10:01:14

Yes I live close by :)

thomas08:01:30

HNY everyone, hope you all had some time off and got to spend it with family/loved ones etc.

borkdude08:01:12

If you're on macOS you might enjoy this: https://github.com/babashka/obb

reefersleep08:01:42

The README would benefit from a cool example that scripts Mac applications 🙂

☝️ 1
reefersleep08:01:43

I’m in the target audience, I think, but I don’t know exactly what I could do with it.

borkdude08:01:19

See examples/choice.cljs

🙏 1
borkdude08:01:25

and other examples

borkdude08:01:04

thanks for the feedback, I'll let this know to zane

borkdude08:01:44

I shared it to the #obb channel

simongray08:01:33

Excellent. This seems very useful. Do you happen to know where Apple documents their own “standard library”? I.e. what is the MDN for Apple’s JS.

borkdude08:01:52

I suggest joining #obb - I think @U050CT4HR is most knowledgable about this API :)

simongray08:01:01

Ok, will do.

zane09:01:50

Let’s see.

zane09:01:18

Unfortunately the documentation is very sparse.

zane09:01:22

There’s also a community-run cookbook: https://github.com/JXA-Cookbook/JXA-Cookbook/wiki

🙏 1
zane09:01:15

I’ll put further replies in #obb.

borkdude09:01:59

@U050CT4HR Perhaps we can put these links in the README

reefersleep09:01:33

@U050CT4HR great that there is already an examples folder. I think it’d be really nice with one or more examples in the README, though; really helps fast comprehension of any project, I find. Perhaps even using a .gif showing the visual result of running a script? That’d be really effective in conveying the power of the library, I think. Just ideas 🙂

zane09:01:26

@U0AQ3HP9U I totally agree, and plan to. I had hoped to make things more presentable before this got any attention but here we are. simple_smile

reefersleep09:01:33

hahaha thwarted by your own success @U050CT4HR

reefersleep09:01:55

I’ll let you get to it, then! 😄

zane09:01:07

If anyone is already taking it for a spin you should probably pull again; I just pushed an important fix.

reefersleep09:01:13

I’m looking forward to see what can be done with this!

borkdude09:01:20

I think it was already quite presentable, so I shared it here and on Twitter 😂

zane09:01:39

See also examples/gui.cljs. Can you create a GUI using this? Yes! Should you? Probably not!

😅 1
borkdude09:01:28

@U050CT4HR I'm getting:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSGetSizeAndAlignment(): unsupported type encoding spec 'G' at 'GPoint}"size"{CGSize}}' in '{CGPoint}"size"{CGSize}}''
for this example :)

borkdude09:01:04

btw @U050CT4HR if something isn't working we'll blame it on me, if it is working you get the credits ;)

😆 1
zane09:01:09

@U04V15CAJ Interesting! That’s for the GUI example?

borkdude09:01:38

I'm on 11.6

zane09:01:07

Ah, that might be it. 12.1.

borkdude21:01:01

@U04V5VAUN You can now run that script straight with obb without using the CLJS compiler.

borkdude21:01:28

I think I found that when searching about this

slipset21:01:35

Apparently some guy named @U04V15CAJ retweeted something at some point in time.

slipset22:01:11

That's from 2014 :)

borkdude22:01:31

Borkdude. (Re)tweeting Clojure since 2010.

borkdude22:01:57

I also had an account named cleotd (clojure example of the day)

borkdude22:01:23

apparently it got hacked or so

borkdude22:01:05

I donated the account after I didn't have time to post an example each day (the bar I had for myself)

borkdude22:01:13

but the people I donated it to didn't either

borkdude22:01:12

@U04V5VAUN Perhaps write a blog post: following up to the blog post from 8 years earlier, you can now use obb. ;)

mdallastella08:01:23

Morning! Happy new year!

dharrigan08:01:37

Good Morning!

dharrigan08:01:56

TIL, Typescript doesn't cast, it asserts!

dharrigan08:01:30

so, you may get garbage from the backend and your TS client will happily continue onwards (until it blows up)

orestis10:01:40

@dharrigan type systems don't usually span network hops. Though Gary Bernhardt is trying to have a unified Type system across Frontend/Backend so that the type checker works across the whole stack.

orestis10:01:57

He was tweeting about it a year ago or so.

dharrigan10:01:03

Yeah, but I thought (mistakeningly) that if you define a type in typescript, then pull it in via fetch (and declare what the fetch promise returns), then, if it tries to then coerce the information from the network into the type, it would complain at runtime

dharrigan10:01:14

i.e., if I declare interface Foo { age: number }, then do Promise<Foo> => (await fetch(....)).json(), then if age comes back as age: "foo bar baz" it would blow up when trying to shove the json data into the Foo type.

dharrigan10:01:20

but alias, it does not.

orestis10:01:38

Ah no, Typescript types go away entirely after compilation, as far as I know. I think there's libraries to try and make these assertions from TS types.

dharrigan11:01:44

Yup, TIL 🙂 I'm teaching myself some frontend dev during this holiday period, so first time trying out typescript (with solid-js).... 🙂 So, just something I learnt today 😉 Thanks for the heads up on the erasure of the types at compilation - I'll investigate further.

orestis11:01:05

I last had a proper look at TS a few years back and gave up on it after a project since I found out that the only addition over ES6 was a type system, no fixing of JS foot guns or additional data structures/standard library. Perhaps things changed since then.

borkdude11:01:19

I think they think that the type system protects you from JS footguns, by Maybe(!) protecting you from nulls, etc.

simongray11:01:44

Our IT department used to leave Mac users alone, but recently they started becoming just as intrusive as they are on Windows, forcing sudden restarts in the middle of our workday giving us no option to cancel.

simongray11:01:13

Like, they will literally initiate a 60 second countdown with no cancel button, force quit everything once it has run out and restart the computer. Then you get to sit there for however long the forced updates take to install and wonder how to recreate your state.

borkdude11:01:39

I once privately bought a Macbook Air for my work because the provided laptops by the institute were too slow (downloaded a profile when you logged in from some network drive) and managed by the IT department.

borkdude11:01:29

I was a lecturer and when you started your class and logged in you wasted 5-10 minutes of your class

simongray11:01:20

Yeah, many of my colleagues have run into that issue (I work at a university). Also, lots of them do machine learning and will leave computers on overnight only to have all of those hours wasted.

simongray11:01:01

The most stupid part is that I can literally do all of my work from my personal computer using VPN to access our intranet. All of the security theatre is meaningless when I can literally use my private laptop for all of the same things.

simongray11:01:55

illusion of control bias

simongray11:01:15

Oh well, at least this time I was having lunch while waiting for the 25 minute update 😉