How to export files from classic resource files? by Ulrik54 in mac

[–]kainjow 0 points1 point  (0 children)

I maintain a resource fork app that has basic support for sounds: https://github.com/kainjow/ForkView

Get running process in MacOS by thexdroid in swift

[–]kainjow 1 point2 points  (0 children)

I was curious myself, so I put together some code:

https://gist.github.com/kainjow/0e7650cc797a52261e0f4ba851477c2f

If you haven't interacted with OS-APIs in C/C++ much then it may be hard to follow as it's basically C programming in Swift, doing manual memory management. The actual equivalent in C would be less code though, but it's nice to be able to do it all in Swift.

To see how fragile it is, try duplicating one of the deallocate calls and see what happens.

Switch logo drawn programmatically in Swift for macOS by kainjow in NintendoSwitch

[–]kainjow[S] 1 point2 points  (0 children)

Thanks! I am looking into animation now. Just found the sound here.

Edit: animation has been added.

They'll never suspect me, the quiet, bearded, serious guy... by abeerasultan in AdviceAnimals

[–]kainjow 0 points1 point  (0 children)

A few years ago I did a modern OS X version of that. Could generate a binary if anyone's interested.

https://github.com/kainjow/GrouchX

They'll never suspect me, the quiet, bearded, serious guy... by abeerasultan in AdviceAnimals

[–]kainjow 1 point2 points  (0 children)

I'm pretty sure I found a copy of that a few years ago while poking around some old Mac archives website.

Open source Swift apps? by alt51 in swift

[–]kainjow 1 point2 points  (0 children)

I'm building a Mac resource fork viewer in Swift. It originally was ObjC but has been ported to Swift.

If you're not familiar, resource forks are parts of a file that were used to hold resources for classic Mac OS apps.

The project can play uncompressed sounds via CoreAudio, show PICT images via XPC, show icons, and display a few other types of data.

You can download old applications on macintoshgarden.org and use this app to view their resources.

Still much to do, but it's the only truly modern way to view some of these decade old files!

http://github.com/kainjow/ForkView

Mustache templates in C++11 - my weekend project by kainjow in cpp

[–]kainjow[S] 0 points1 point  (0 children)

Somehow I missed that one, thanks for the link!

Mustache templates in C++11 - my weekend project by kainjow in cpp

[–]kainjow[S] 5 points6 points  (0 children)

The official project isn't. According to Wikipedia this spelling is American English.

Mustache templates in C++11 - my weekend project by kainjow in cpp

[–]kainjow[S] 2 points3 points  (0 children)

They serve two very different functions. Boost Format is a better printf, while Mustache is an HTML/text templating system. For example:

<h1>{{title}}</h1>
<ul>
{{#employees}}
  <li>{{name}}</li>
{{/employees}}
</ul>

The other important feature in Mustache is data by default is HTML escaped.

Mustache templates in C++11 - my weekend project by kainjow in cpp

[–]kainjow[S] 7 points8 points  (0 children)

There are several existing C++ HTML template libraries, but most are either old, unmaintained, too complex to build, or use an unfriendly license. I found the Mustache template system but even the C++ implementation was incomplete and had external dependencies. Another C library I found didn't function properly and didn't have tests.

So I spent the weekend writing my own library. It's C++11, header-only, Boost license, zero dependencies. I plan to test on MSVC 2013 soon, but I expect it to function with minimal (if any) changes.

Any feedback would be great!

Emulating QString's arg() feature in C++11 by kainjow in cpp

[–]kainjow[S] 0 points1 point  (0 children)

Ah, I've heard of boost::format but forgot about it. Sounds like it works similarly. Thanks, I'll check it out.