4 ms·
Show HN: Codeblock.js - Editable, runnable javascript code blocks
- macmac 13y agoBroken in Chrome Version 27.0.1453.81 beta.
- liyanchang 13y agoHmm. Thanks for reporting. Mind creating a github issue with a screenshot? https://github.com/Filepicker/codeblock.js/issues https://github.com/Filepicker/codeblock.js/issues Or if you elaborate more here, I'll create the ticket for you.
- gildas 13y agoI guess I have the same issue with Chromium (29.0.1506.0). Codeblock demos won't work because 'codeblock.js' is served with the wrong MIME type (i.e. 'text/plain') and the browser refuses to execute it. You could host your JS file on GitHub pages (i.e. 'github.io' domain) to fix this issue. edit: Sorry, I didn't notice you were not the poster. I'll create an issue.
- nodesocket 13y agoGitHub intentionally does this now to prevent hot linking. The MIME-TYPE is set to `text/plain`, which the browser then denies running.
- jdkanani 13y agoSandstorm is very good.
- kahoon 13y agoI've tried clicking on run and then refresh. I repeated this process 8-9 times and then the animation in the first example started to lag considerably.
- liyanchang 13y agoDuplicated. Not sure why. Will have to do some more digging but created a github issue for it. https://github.com/Filepicker/codeblock.js/issues/1 https://github.com/Filepicker/codeblock.js/issues/1
- brettcvz 13y agoThis is dues to a memory/cpu "leak" because when you press reset it doesn't run "clearInterval". This could be done via introspection on the code to "undo" any running intervals/timeouts when the reset button is pressed, but the notion of "reset" is to reset the text, not reset the code, so leaving as is.
- pfraze 13y agoI like it! Nice work, filepicker team
- zackbloom 13y agoAn alternative which supports other languages and uses CodeMirror rather than Ace editor: https://github.com/HubSpot/executr https://github.com/HubSpot/executr
- brettcvz 13y agoHa nice... well now there's two!
- methehack 13y agoAre there any reasons to be worried about security?
- leeoniya 13y agokind of related, you guys may or may not be interested in https://github.com/leeoniya/preCode.js https://github.com/leeoniya/preCode.js basically, it's a small snippet which lets you write code within textareas without having to mangle them in the source, like un-indenting. i've been using it a lot for writing static docs/demos for my projects.
- nornagon 13y agoAlso related: http://github.io/nornagon/live http://github.io/nornagon/live, uses esprima to transform into a live-editable model that can be updated without recompiling if you just change literals.
- g2e 13y agoI read this as cockblock.js and was expecting something more amusing.