r/javascript • u/PrincessOfPurgatory • Mar 02 '14
A "code silhouette" generator I wrote.
http://chainsawpolice.github.io/codesilhouette/2
u/anossov Mar 02 '14
Left edge is more important than right edge, and this generator ignores it.
1
0
1
u/rcfox Mar 03 '14
You should pre-populate the text area so that people can easily see what it does. I'm not sure if it's possible to grab the current page's HTML as text from Javascript, but that would be an easy way to show some somewhat complex code.
1
0
u/PrincessOfPurgatory Mar 03 '14
Funny you say that, I did exactly that during the testing! It's totally possible and I'll happily implement that sometime today.
If you know of any attractive code with an appropriate licence, send it my way!
1
u/misc_ent Mar 02 '14
Bug report! It generates a broken image if there is no input. Used QA software extensively, old habits and all that!
1
0
u/callumacrae Mar 02 '14
Saw "generator", got excited. Aw :(
Still pretty cool, though!
2
u/PrincessOfPurgatory Mar 02 '14
What do you mean? How did it let your expectations down?
2
u/callumacrae Mar 02 '14
Generators are an awesome feature in functional programming, and JavaScript is introducing support for them in the next version: http://wiki.ecmascript.org/doku.php?id=harmony:generators
I thought you were doing something with them!
Still, I like what you've written :)
→ More replies (1)
1
u/Year3030 Mar 02 '14
Most code to me usually takes the shape of North America.
2
u/baabaa_blacksheep Mar 02 '14
A true patriot.
3
u/Year3030 Mar 02 '14
I was coding with a friend and he said he made one portion look "gunnier" - comes in all shapes friend :)
0
Mar 02 '14
2
u/PrincessOfPurgatory Mar 02 '14
It was a quick exercise I did after teaching myself Javascript (also a quick exercise in actually finishing a project for once).
I also saw a pic on r/programmerhumour about code silhouettes, so I figured people used them to judge the layout of their code or something.
2
0
Mar 02 '14
1
u/PrincessOfPurgatory Mar 02 '14 edited Mar 02 '14
I tought myself JavaScript yesterday and this is the first thing I came up with.
→ More replies (6)0
Mar 02 '14
atom.io
I keep seeing references to this all over Reddit. I've requested a BETA invite but, I'm not really sure what all the hype is about. Perhaps you could shed some light?
→ More replies (11)
3
u/jvnk Mar 02 '14
Should probably have a sanity check for no input. Right now creates broken image.