Tobias Ahlin / Blog

@tobiasahlin

Infinite Scroll With Jekyll

Read more

If you want to use Jekyll but don’t want to settle with a list of links to your blog posts, I just open sourced the parts that drives this blog’s infinite scroll. As I mentioned in Moving from WordPress to Jekyll, the implementation is built around collecting the links to all blog posts in a JSON file, and using that to load more posts as you scroll.

If you’d like to add this juicy feature to your Jekyll site, head over to GitHub and grab the source, and let’s get started.

Read more

Chaining in jQuery

Read more

Chaining in jQuery let’s you write code that is faster to execute, easier to read, and easier to maintain. Even if you haven’t heard of chaining, if you’ve worked with jQuery it’s likely that you’ve already seen jQuery code utilizing chaining.

So what does it look like? Let’s compare two snippets of code—they accomplish the exact same thing, but one uses chaining, and the other one doesn’t:

Read more