klipse

Yehonathan Sharvit 2016-12-07T16:07:03.000030Z

@jrheard I want to publish a “Hall of fame of web pages with interactive code”. I have started to work on it

Yehonathan Sharvit 2016-12-07T16:07:05.000031Z

http://klipse.ghost.io/p/2ee36df8-b302-4035-b233-94816b3cac90/

Yehonathan Sharvit 2016-12-07T16:07:13.000033Z

But I’m not such a good designer

Yehonathan Sharvit 2016-12-07T16:07:22.000034Z

Maybe you have a couple of advice to improve the page

Yehonathan Sharvit 2016-12-07T16:08:06.000035Z

For the moment, it mentions only 2 pages but I have already 10 that I will had later - when I’m done with the layout

Yehonathan Sharvit 2016-12-07T16:08:41.000037Z

@hmadelaine maybe you could help with ⬆️ ?

jrheard 2016-12-07T16:37:00.000039Z

@viebel looks good so far! i like the gifs, great way of communicating the articles’ interactivity the only nitpick i have is that the facebook like widget seems out of place - i think i’d remove it entirely and the reddit links look pretty good, but they take up a moderate amount of space and probably don’t actually provide much value to the person reading the article - i’d probably remove the reddit widgets too aside from that, i can’t think of anything i’d change!

Yehonathan Sharvit 2016-12-07T16:38:44.000040Z

ok

jrheard 2016-12-07T16:38:52.000041Z

(although perhaps 'the best interacitve web pages with interactive code’ could be reworded (and the first ‘interactive' has a typo); not sure what i’d use instead, thinking)

Yehonathan Sharvit 2016-12-07T16:38:52.000042Z

thanks for your input @jrheard

jrheard 2016-12-07T16:38:55.000043Z

npnp

jrheard 2016-12-07T16:39:43.000045Z

i like what you used in your slack message a bit better: “Hall of fame of web pages with interactive code"

jrheard 2016-12-07T16:39:50.000046Z

i think it’s nice and simple

Yehonathan Sharvit 2016-12-07T16:39:59.000047Z

ok.

Yehonathan Sharvit 2016-12-07T16:40:05.000048Z

I like it more also

jrheard 2016-12-07T16:40:07.000049Z

😄

Yehonathan Sharvit 2016-12-07T16:41:01.000050Z

another thing @jrheard related to console.log in klipse snippets

Yehonathan Sharvit 2016-12-07T16:41:41.000051Z

First of all, I implemented your idea, and now, when you print inside a clojure code snippets the result is appended to the result cell

jrheard 2016-12-07T16:42:41.000052Z

niice

Yehonathan Sharvit 2016-12-07T16:44:12.000053Z

But it doesn’t play well with asynchronous code like setTimeout

jrheard 2016-12-07T16:44:16.000054Z

ah dang

Yehonathan Sharvit 2016-12-07T16:44:16.000055Z

Take a look here: http://klipse.ghost.io/p/0ad45113-1483-458c-b895-d0327b792411/

jrheard 2016-12-07T16:44:37.000058Z

ahh

Yehonathan Sharvit 2016-12-07T16:44:49.000059Z

The was I did it is with (binding [*print-fn* …)

jrheard 2016-12-07T16:45:00.000060Z

nice, makes sense

Yehonathan Sharvit 2016-12-07T16:45:25.000061Z

but dynamic scope and asynchronous stuff cannot work

Yehonathan Sharvit 2016-12-07T16:45:31.000062Z

or at least not for the moment

Yehonathan Sharvit 2016-12-07T16:45:35.000063Z

makes sense?

jrheard 2016-12-07T16:46:06.000064Z

yeah

Yehonathan Sharvit 2016-12-07T16:46:09.000065Z

Anyway, that’s not my issue

Yehonathan Sharvit 2016-12-07T16:46:20.000066Z

For clojure, I am not trying to solve it for the moment

Yehonathan Sharvit 2016-12-07T16:46:31.000067Z

But I think I found a solution for javascript

Yehonathan Sharvit 2016-12-07T16:46:36.000068Z

using lexical scope

Yehonathan Sharvit 2016-12-07T16:46:55.000069Z

instead of (js/eval exp)

Yehonathan Sharvit 2016-12-07T16:47:37.000070Z

I’m wrapping exp into an anonymous function with console like this

Yehonathan Sharvit 2016-12-07T16:49:57.000072Z

function(console) {
eval(exp);
}({log: myLogger})

Yehonathan Sharvit 2016-12-07T16:50:04.000073Z

and it works fine!!!!

Yehonathan Sharvit 2016-12-07T16:50:25.000074Z

👏😎👌

Yehonathan Sharvit 2016-12-07T16:50:31.000075Z

do you follow me?

jrheard 2016-12-07T16:50:57.000076Z

gotcha, yeah, you’ve gotta pass along some sort of way of associating the evaluation with the specific klipse snippet you want the output to be written to, is that right?

Yehonathan Sharvit 2016-12-07T16:51:07.000077Z

exactly

Yehonathan Sharvit 2016-12-07T16:51:16.000078Z

now I’d like to go one step further

Yehonathan Sharvit 2016-12-07T16:51:29.000079Z

to handle calls to console.time, console.error etc...

Yehonathan Sharvit 2016-12-07T16:52:04.000080Z

But I don’t want to override all of them

Yehonathan Sharvit 2016-12-07T16:52:34.000081Z

my question is: do you think there is a common printer function called by console.log, console.time, console.error etc...

Yehonathan Sharvit 2016-12-07T16:52:46.000082Z

Then I’d need to override only one function

jrheard 2016-12-07T16:53:10.000083Z

hm, i wonder if there’s a way to see the source of those functions, i’ve never tried to do that

jrheard 2016-12-07T16:53:12.000084Z

perhaps not, checking

jrheard 2016-12-07T16:53:21.000085Z

i bet it varies from browser to browser

jrheard 2016-12-07T16:54:11.000086Z

yeah, not sure how to see that