

Show HN: Codeblock.js - Editable, runnable javascript code blocks - brettcvz
http://filepicker.github.io/codeblock.js/

======
g2e
I read this as cockblock.js and was expecting something more amusing.

------
kahoon
I'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
Duplicated. 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>

~~~
brettcvz
This 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.

------
macmac
Broken in Chrome Version 27.0.1453.81 beta.

~~~
liyanchang
Hmm. Thanks for reporting. Mind creating a github issue with a screenshot?
<https://github.com/Filepicker/codeblock.js/issues>

Or if you elaborate more here, I'll create the ticket for you.

~~~
gildas
I 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
GitHub intentionally does this now to prevent hot linking. The MIME-TYPE is
set to `text/plain`, which the browser then denies running.

------
nornagon
Also related: <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.

------
zackbloom
An alternative which supports other languages and uses CodeMirror rather than
Ace editor: <https://github.com/HubSpot/executr>

~~~
brettcvz
Ha nice... well now there's two!

------
leeoniya
kind of related, you guys may or may not be interested in
<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.

------
methehack
Are there any reasons to be worried about security?

------
pfraze
I like it! Nice work, filepicker team

------
jdkanani
Sandstorm is very good.

