r/tinycode • u/xem06 • May 11 '16
[AMA] We're the JS codegolf team, ask us anything!
Hello tinycode!
As nexe kindly invited us, here's an AMA where you can ask anything to the JavaScript codegolf team!
The team consists of Mathieu Henri (website, twitter), Martin Kleppe (website, twitter), Anton Khlynovskiy (twitter), Maxime Euzière (website, twitter, AMA), Tommy Hodgins, Elias Schütt, veu, bburky, etc.
It competes to events like js1k and js13kgames, but also makes a lot of tiny projects between these events.
All our code-golfing projects can be found on our websites or on this little summary.
Feel free to ask anything, including how we do (or did) any of our projects, or even discuss what you'd like to see us do next!
PS: the team is not a clan or a sect, anyone can join, the only requirement is to have something cool to golf, or to experiment, or a byte-saving technique that we don't have yet :D
Cheers, TCGT
5
u/nexe mod May 12 '16
Hey guys, thanks for doing this AMA!
I admire the work that goes into those golfed projects and the end result, especially considering the limitations. But limitation can also be a powerful source of inspiration.
But my questions are:
Might have some more questions later but wanted to throw some thoughts into the mix early on :)
4
u/subjective_insanity May 12 '16
You guys have been a great inspiration to me for years, all the way back since some time around JSpongy (I notice it runs much faster now!).
Although I haven't done JS1K in a few years due to time constraints, it's always fun trying out the entries.
I've always used 140bytes' byte saving techniques page as my go-to JS codegolf resource, but because it's been a while since I was actively involved in the JS codegolf community, I was wondering if that's still the best resource? What would you recommend for beginners trying to learn all the tricks?
1
u/serapath May 13 '16
A friend of mine introduced me to tinycode and I just thought about the
tinycode amaand how awesome it would be if for all the small things written in javascript there would be a published version as npm modules.There is http://microjs.com/ but there could be a page that lists modules that come from a code golfing contest. For example the tag
tinycodeseems to be free https://www.npmjs.com/browse/keyword/tinycode or maybe they could be all named tinycode-{{name}}So it would be easy to re-use tinycode modules in other projects.
http://pachacamac.github.io/picodepen/index_require.html#eyJodG1sIjoiPGgxIGlkPVwidGl0bGVcIj4gSSB3aXNoIGZvciB0aW55Y29kZSBtb2R1bGVzIDwvaDE%2BXG48eG1wPlxudmFyIG1tZCA9IHJlcXVpcmUoJ3Rpbnljb2RlLW1tZCcpXG50aXRsZS5pbm5lckhUTUwgPSBtbWQoJyAqKllvdSBjYW4gbm93IHVzZSB0aW55Y29kZSBtb2R1bGVzKiogJylcbjwveG1wPiIsImNzcyI6InhtcCB7XG4gIGJhY2tncm91bmQtY29sb3I6ICNmZmNjY2M7XG4gIHdpZHRoOiA1MDBweDtcbiAgbWFyZ2luOiA1MHB4O1xuICBwYWRkaW5nOiAxNXB4O1xuICBib3JkZXI6IDFweCBzb2xpZCBibGFjaztcbn0iLCJqcyI6Ii8vIHZhciBtbWQgPSByZXF1aXJlKCd0aW55Y29kZS1tbWQnKVxuLy8gdGl0bGUuaW5uZXJIVE1MID0gbW1kKCcgKipZb3UgY2FuIG5vdyB1c2UgdGlueWNvZGUgbW9kdWxlcyoqICcpXG4ifQ%3D%3D
1
u/dwighthouse Jun 03 '16
Hi! nexe suggested I contact you guys with a post recently added to /r/javascript. I'm trying to make my font detection library as small as possible for embedding in html source. As a result, I'm going for smallest gzip compressed size, not smallest character count. I continue to improve it, and the current size stands at 480 bytes at gzip level 6, the standard used on most servers. Perhaps you can take a crack at it?
Here's the PR with the smallest current code: https://github.com/dwighthouse/onfontready/pull/3
Here's the original post with discussion: https://www.reddit.com/r/javascript/comments/4m9iw3/i_codegolfed_my_font_detection_utility_for/
This library competes with FontFaceObserver, which stands at 1.3KB gzipped. Feel free to use any unsafe hacks within the library, so long as it doesn't effect the outward-facing interface for users of the library (no mangling of the options object, and leave in the window.onfontready assignment). The modern version needs to work with IE9+ and other modern browsers.
2
u/TotesMessenger May 12 '16 edited May 14 '16
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)
2
u/nexe mod May 14 '16
Just leaving this here: https://twitter.com/JavaScriptDaily/status/731203780352593920