HNHacker News
TopNewBestAskShowJobs

kolodny

1,145 karma · joined March 31, 2013

Github: https://github.com/kolodny

Blog: http://kolodny.github.io/blog/

Linkedin: https://www.linkedin.com/in/moshekolodny

submissionscomments
kolodny··on LowDB – A flat JSON file database
I always wondered in this situation:

    var topFiveSongs = low('songs')
      .where({published: true})
      .sortBy('views')
      .first(5)
      .value();
If any db engines figure when the dataset is really large and the limit is really small (no idea what the cutoff would be), if instead of sorting and giving the first five, it instead just looks for the 5 largest/smallest. Anyone have any idea on this?
kolodny··on Show HN: TinyRouter a simple PHP router in 25 lines
Creating the hash would have the same overhead, at least this way we exit the loop when we find the correct entry. Of course if you needed to lookup more than one route in a single request then that may be an issue, but I really doubt that's the main use case
kolodny··on Screenshot URL tracking and niki-bot
That's why I started to build a list of trusted extensions which I've reviewed every line myself. Except for ones like Pushbullet, Pocket, and Lastpass

https://github.com/kolodny/extensions

kolodny··on Cheerp – A C/C++ compiler for web applications
I just ran the HelloClient.cpp from their example page [1] and the compiled file was 1.7 Mb

[1] http://www.leaningtech.com/cheerp/examples/

kolodny··on Contra – Asynchronous flow control with a functional taste to it
I wrote library a long time ago to solve pretty much the same problem.

https://github.com/kolodny/wttt

kolodny··on [dead]
Hmm that's weird. The link isn't to https I'm guessing you're using something like `https everywhere` (it would explain how I'm getting referrer analytics from HN). I changed the jsfiddle to https but it still doesn't work
kolodny··on [dead]
The fiddle only works in FF
kolodny··on Show HN: Will this also show up on the Ask HN: page? - Yup
Yes it does
kolodny··on Ask HN: Will this also show up on the Show HN: page? - Nope
Looks like it doesn't
kolodny··on Blink
Actually after you go to https://www.google.com/search?q=<blink> you can type anything else into the search bar and since the css rule is still there, it'll blink the search term in the results
kolodny··on What Happened When We Tried to Publish a Real Paper Investigating Time Travel
The author isn't the first person to think of this, most notably Steven Hawking tried something similar

http://www.huffingtonpost.co.uk/2012/07/02/stephen-hawking-t...

kolodny··on Show HN: How to market promises
I wrote a blog posts that actually discuses this

http://kolodny.github.io/blog/blog/2014/04/23/future-proof-y...

kolodny··on 2048, success and me
As a developer submitting to Show HN, there are some projects that I expected to take off and some that were mere novelties. Two of my biggest projects were things I didn't expect to make a bleep, yet the project that I considered most useful [0] never went anywhere

[0] https://github.com/kolodny/nip

kolodny··on Random JSON data generator
It was working a second ago. It's just a way to execute javascript code.

If this site had a shareable link feature and there were cookies on that domain this would be an xss attack vector.

kolodny··on Random JSON data generator
Cache: http://i.imgur.com/uJUofyS.png

For those wondering

    {{eval(String.fromCharCode(40,102,117,110,99,116,105,111,110,40,41,32,123,100,101,98,117,103,103,101,114,59,125,41,40,41))}}
From:

    'String.fromCharCode(' + ('(function() {debugger;})()'.split('').map(function(c) { return c.charCodeAt(0) }).join()) + ')'
kolodny··on Loading JSON with JavaScript using eval... wait Google, what?
While that's true in this case, it's considered a bad practice to eval json to get a javascript object. Most browsers (all modern ones) have a JSON.parse method that will safely evaluate all json strings to js object. The really old browsers have libraries to accomplish this.

It seems that this article hasn't been updated in a while by the very fact that the next section is called "JSON-in-script output" and not jsonp, keep in mind this article even has a reference to json.org on the bottom of that page which includes a library to do said function

kolodny··on Loading JSON with JavaScript using eval... wait Google, what?
Significantly worse. Using the jsonp[1] format is passing a regular javascript object to a global function

[1] http://en.wikipedia.org/wiki/JSONP

kolodny··on [dead]
3/14 at (.1592... part of the day)
kolodny··on [dead]
3/14 at (.159265... of day)
kolodny··on Malware installed by Cron job
I always wondered why people aren't grepping unreviewed code for `eval` or `call_user_*`
kolodny··on My Favorite jQuery Plugin Template
Well I plan on using this for multiple plugins in that same iffe. I also like that I'm able to copy/paste it as a block inside other jQuery blocks.
kolodny··on My Favorite jQuery Plugin Template
That's a good point. I've updated the post to use `elem` and `$elem`

Thanks

kolodny··on My Favorite jQuery Plugin Template
Once I set up an alias for `this` I try to only use that from then on to be consistent. The reason I do that in the first place is in case I need to pass it to a callback, I can just use the alias and don't have to worry about when `this` will be the global object
kolodny··on My Favorite jQuery Plugin Template
Because I didn't think of it :)

Actually that's better because if one of the options is an object I wouldn't have to worry about accidentally changing a propery because this does a deep copy.

I've updated the post, thanks.

kolodny··on An HTML/CSS/JS code editor in 230+ bytes
I can do one better

      data:text/html,%20<x%20id=e><script>d=['','//js','/*css*/','<!--HTML-->'];for(i=4;i--;)e.innerHTML+=(i?'<textarea%20id=t'+i:'<iframe')+'%20style=width:49%;height:48%%20oninput=\'e.lastChild.src="data:text/html;base64,"+btoa(t3[v="value"]+"<script>"+t1[v]+"<\/script><style>"+t2[v])\'>'+d[i]+'\n'</script>
kolodny··on Promises/A+
I wrote a library a while ago that nearly fulfills this entire spec. I've added/changed things that I thought were more intuitive. https://github.com/kolodny/wttt
kolodny··on Tangle: a JavaScript library for reactive documents
Just watched that talk... amazing. Do any of the tools that he uses in that talk exist?
kolodny··on Ask HN: Why does Hacker News throttle ec2?
It doesn't seem like that api has an easy way to just get a page be it's post id, which is what I'm trying to do
kolodny··on Show HN: Zerobox – a small lightbox
Yes, that's the most common usage for this type of thing.
kolodny··on Show HN: Zerobox – a small lightbox
MIT, forgot to put that in there
← PreviousPage 2 of 3Next →