5minutenpause

Blogging with Ghost

| Comments

Happy New Year!

Review of blogging software

Not long after writing my review for 2015, I set out to find a new blogging system for this very site.

My list of necessary features is relatively short:
* A web interface
* A way to write drafts and publish them from the web interface
* Writing in Markdown
* Ability to import my existing posts
* No PHP

The last point scratches the obvious(?) choice from the list of candidates (Wordpress). That left me with surprisingly few choices.

2015 in review

| Comments

While I haven’t written any year-in-review posts here for the last years, I always find them interesting to read. I caught myself looking back on the year these last days, and I’d like to write my thoughts down. So this review is mostly intended for myself, but if it’s interesting for you that’s fine for me too. :-)

Work

On January 1st 2015 I started to work (again) at ikusei. It’s a web agency in Berlin. I took a break from working there from 2013 to 2015 and now I am back. I am working together there with my (now) wife (see below) and it’s the second best decision I made last year. Lots of people told us to be careful and that it wouldn’t work out. I am glad to say they are wrong. We felt perfectly equipped and “trained” to work together because we’ve been together for almost 9 years now and because of raising our daughter. If you can manage to do these things well together without getting on your nerves and even enjoying the every day than working together is like a sunny day in the park.

What I’ve found for October 28, 2015

A new round of interesting links about web development.

Garage made, self hosted NewRelic alternative with Ruby, Sinatra, Grafana and InfluxDB
This is an interesting version. I use NewRelics free version and it’s enough for my use cases. But perhaps people with more time than money should try this out. It’s definitely for the tinkerers.

Basic CSS Selector Syntax Explained Using Cats

CSS can be tricky. Learn some basic selector syntax with cats!

This is a fun post. If you’re new to CSS or need some refreshing, it’s worth a look.

Idle Time » Unicode date formats, YYYY?!
Everything regarding multiple languages and/or localization in web and native apps is difficult. I worked on many localized apps already and there are many hoops you have to jump through. This post explains how to format years in your date strings.

State of Web Type

Up-to-date data on support for type and typographic features on the web.

The quote says it all. Every web developer will need this.

Hit reply and let me know what you think about these.

Holger

How do you cache collections in Rails

| Comments

If you want to speed up your Rails website you’ve probably heard of caching. When talking about caching people always tell you to make sure you invalidate the cache at the right time. Otherwise you risk displaying old content. So when is the right time to invalidate a cache for a collection of objects in Rails? What do you do if only one object changes? Is it really worth it to do this?

The answer is ‘yes’. It is almost always worth doing it. Cache invalidation should be done by choosing the correct cache key. If you have a collection of ActiveRecord objects a nice approach could look like this.

1
2
3
4
5
6
7
8
9
articles = BlogArticles.active # or any other collection
cache_key = [blog-articles, articles.map(&:id), articles.maximum(:updated_at)]

@cached_articles = Rails.cache.fetch(cache_key) do
  # This is run if the cache is empty, e.g. on a new cache_key
  # Fetch you articles here.
end

# continue with your cached articles

Thanks for reading and don’t miss my next post. Enter your email in the box at the top of the page.

What I’ve found for March 09, 2015

tiimgreen/github-cheat-sheet :

github-cheat-sheet - A list of cool features of Git and GitHub.

Awesomplete: Ultra lightweight, highly customizable, simple autocomplete, by Lea Verou : What do you use for autocompletion? Have a look at this little widget.

Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.

HTML5 number inputs – Comma and period as decimal marks | Aeyoun : Have you ever tried to input a number with either comma or dot and it didn;t work as you expected?

will open a numeric software keyboard on modern mobile operating systems. Not every user can input decimal numbers into this convenient field without proper localization.

The Best Static Blog Generator: Middleman vs Jekyll : I use Octopress (which uses Jekyll under the hood) for this blog. When I find the time, I’ll update to either Octopress 3 or just Jekyll. I am not sure yet.

David Turnbull pits Jekyll and Middleman, his two favorite static blogging tools, against each other and looks at where each tool excels.

Rails Garbage Collection: Tuning Approaches - by Lourens of Bear Metal : Garbage collection is a topic I have yet to do anything with. On iOS it was a major topic, but I never considered it for Rails. Bookmarked for future reference…

Rails Garbage Collection: Tuning Approaches Lourens wrote this on Feb 20th, 2015 9:19 am MRI maintainers have put a tremendous amount of work into …

www.dotnetperls.com : Several examples how #split works on Strings. Useful for Ruby beginners.

What I’ve found for March 01, 2015

New Site - Thoughts and Considerations - MartinWolf.org - Freelance Web Developer : Martin redesigned his site. I always like to read about people’s workflows.:

As you may have noticed I redesigned this very site. Since going freelance I only had the blog which also acted as my portfolio of sorts

Introduction to the React JavaScript Framework -Telerik Developer Network : Perhaps you’ve never tried out React until now. Here’s your next chance: “React is a JavaScript library created by a collaboration of Facebook and Instagram. Its aim is to allow developers to create fast user interfaces easily. React makes no assumptions about the rest of the technology stack used, thus it’s easy to try it out on a small feature in an existing project.”

Your nesting is harmful — Medium : Two years ago we’ve started adding a preprocessor, Sass to be more precisely, to our toolchain. … What started as a wonderful journey at the time ended up in a not so beautiful picture about the usage of preprocessors. I’ve learned a lot in the last two years and I’ve seen some of these opportunities used in an alarming way, especially nesting.

Server-side rendering of Single Page Apps : Michael Mahemoff discusses an alternative approach to server-side rendering of Single Page Apps. I don’t really like his idea, but perhaps you do?: “But what if you don’t have, or don’t want to have, your server-side code base in JavaScript? You could still separate out a web tier microservice (it’s the future!) in JavaScript. If you don’t want to do that, you could pre-render every page using a headless browser and build it as a static HTML file. That has the advantage of being super-fast, but …

Critical CSS and Performance – David Bushell – Web Design & Front-end Development – David Bushell make websites. I help small businesses, start-ups, individuals, and fellow web agencies make the most of their web presence. : David optimized his site to show content as quick as possible. Read how: “By inlining critical CSS the browser can start to render immediately while the rest is downloaded asynchronously. What is critical CSS? Anything above the fold apparently. PageSpeed Insights is a useful tool. My original stylesheet was only 35KB so I was skeptical that I’d see any improvements. Nevertheless, I manually extracted 10KB of typographic and layout styles to inline.”

www.leighhalliday.com : A Struct in Ruby is one of the built-in classes which basically acts a little like a normal custom user-created class, but provides some nice default functionality and shortcuts when you don’t need a full-fledged class. Below I’ll discuss some of the different places you might want to use a Struct, but first let’s look into what a Struct looks like and a comparable class.

What I’ve found for February 27, 2015

Unfortunately I can’t write a real article these days because I am sick at home. But I can at least (semi-automatically) publish the latest links I’ found during the last few days.

Enjoy.

medium.com
: An in-depth look at the new Origami release and how it’s used at Facebook.

company.myshopify.com
: Debugging is always challenging, and as programmers we can easily spend a good chunk of every day just trying to figure out what is going on with our code. Where exactly has a method been overwritten or defined in the first place? What does the inheritance chain look like for this object? Which methods are available to call from this context?

blog.lunarlogic.io
: Last week Ania Ślimak was talking about putting model on a diet. She presented a nice approach of reducing fat from models using validation factory. This solution is useful in many cases, but may not solve all the problems, so I wanted to continue this topic.

Menu to cross icon
: Perhaps you’ve seen the hamburger icon turning to a cross upon click. Here several ways to do it.

The Battle Of Build Scripts: Gulp Vs Grunt
: I’ve already written about how to get started with Gulp as well as how to get started with Grunt. They both automate our tasks, they both use Node, and they both require you to create tasks and install plugins of some sort. But do you wonder about the difference between the two, or even, which is better?

BrowserSync 2.0 - JH
: What started as a simple Grunt task capable of auto-reloading browsers and injecting CSS, has now evolved into a indispensable tool used by Designers and Developers all over the world in their quest to offer device-agnostic experiences when building for the Web.

My Sass Breakpoints Mixin
: Martin Wolf: “Working on a website nowadays almost always means that you need to use media queries to make the website adapt to certain viewport sizes or environmental changes.” This mixin makes your life easier if you don’t use any frameworks for managing your media queries.

mattgemmell/Jekyll-Multipage · GitHub
: Matt Gemmell wrote a Jekyll plugin for multi-page articles. I don’t know when or if I’ll use it, but it’s nice to have.

Different methods for merging ruby hashes - Paperless Post Dev Blog
: Benchmarking merge and merge! For methods you use that often, it makes sense to know the downsides of each.

Set Intersection in Ruby - Toby’s Ramblings
: There are times when you have two or more groups of data and you want to know what is common between them. When this happens it is good to know about set intersection.

Rails::Application class - railties (4.2.0) ruby gem documentation - Omniref
: Comprehensive documentation for the Rails::Application class including guides, examples, and source code, developed for ruby programmers.

Open Source Sunday
: Yesterday, two great things happened. 1. I published my first gem! Last week I wrote about how we implemented dynamic meta tags for sharing poster previews on social media. I decided I’d extract that into a gem. It’s pretty basic but it’s a great… | Jure Zove | Software writer.

I’ve noticed a pattern

| Comments

I’ve noticed a pattern of lately. It has to do with developer’s desks and their style to work. Perhaps I am too superficial with this. The thing I noticed is, that developers who keep their desks organized neatly and take the time to clean up their desks before they leave at night, are also the ones who clean up their code and their projects.

I have a drawer beneath my desk and every night before I leave, I put loose things in there; to have them off the desk and stored away. This way, when I come to my desk in the morning, I have a clean area and don’t have to wade through stuff from yesterday. I try to organize code in a similar manner: After I’ve written some code or implemented a feature, I take another look at it and try to find ways to optimize it. To have it better organized.

Last week I started using Pronto to help me with this job. The verdict after the first week? Big win. I showed a co-worker what I was doing and he started to try Pronto as well. Both of us liked it and will keep using it.

Do you have similar patterns?

What I’ve found for February 20, 2015

Rails on Docker : Docker is a tool which allows developers to define containers for applications; this allows for control over the operating system and software running the application. If you’re running against an older version of MySQL, a patched version of Ruby, or other dependencies which make setting up a development environment difficult, Docker may simplify development across a team. Even without complicated dependencies, forced encapsulation within a VM ensures development parity across a team and, if deploying with Docker to staging or production, across environments.

http://voltframework.com/docs : I played around with the tutorial for Volt framework. Looks interesting. Can’t hurt to try something more advanced than the tutorial, I guess.

Using events to decouple Rails applications | Redbooth Engineering : See next entry. :) Decoupling applications, microservices etc.

Scaling Complex Rails Applications | Varyonic : What is the best way to architect complex applications using Ruby on Rails? It’s a topic I am reading quite a lot about these days.

Why attr_accessor is 3x faster than getters and setters, and 8x faster than define_method - Omniref : There are 11 types of method calls defined inside the Ruby VM which have existed virtually untouched since @ko1’s first release of YARV (aka ruby 1.9) more than 5 years ago. Each type of method has it’s own characteristics. Here’s a quick benchmark demonstrating the wildly different performance characteristics between some of the most common flavors.

A small workflow for Editorial for iOS

| Comments

I don’t know if I’ve ever written about my workflow for publishing this site. I often write drafts or even complete articles while on the go. Usually when commuting to or from work. My commute is about an hour either way so that gives me plenty of time to write things for you or my newsletter.

When I am on my mobile devices I either write using the iPhone (6) or my trusty old iPad (3rd Gen with LTE).

The app I am using is Editorial for iOS. I used to write with IA Writer Pro but I had one specific problem with it: I like to use the correct typographic quotes in my writing (’ <- this one). IA Writer has a specific button for these and it looks gorgeous when writing. As I always write using Markdown I need to export it into my Octopress blog and generate HTML pages from it. Typographic quotes break everything and don’t work. So I started to use Editorial’s workflows to replace the quotes with their HTML entities. So inside my text a “’” or “’” becomes &rsquo;.

Here’s the Editorial workflow for that, in case anyone else wants to use it.

Thank you for reading.