Automate Building GitHub Pages That Use Jekyll Plugins

As of the writing of this article, this blog’s content is generated using Jekyll and hosted on GitHub Pages. Until recently all was well: I pushed my code to the master branch on my website’s repository and GitHub took care of generating the website for me using Jekyll. All this changed when I started needing to use a custom Jekyll plugin, as GitHub Pages don’t support custom plugins due to security concerns.

»
Author's profile picture Nicu Surdu

How to Fix APC Back-UPS ES Constant Beeping Problem

Lately my APC Back-UPS ES 700 was crippled by the problem that seems to kill most of it’s models: after a surge event, instead of switching to battery it starts to continuously beep. For a while I could restart it several times and the problem would go away, but in the past few days nothing would make it turn on again without constant beeping.

»
Author's profile picture Nicu Surdu

Use DigitalOcean as Dynamic DNS

I have a server at my home on which I host various test projects and I needed a dynamic DNS service as my ISP assigns me an IP dynamically. Tried some dynamic DNS services, but their domain names tend to get long, and I don’t like typing URLS. So I decided to buy a domain and handle the DNS update myself.

»
Author's profile picture Nicu Surdu in #web

Disable Margin Collapse in CSS with No Visual Impact

When working with CSS you sometimes have to work around a behaviour known as margin collapsing. Basically, the top/bottom margin of two neighboring block elements will be set to the biggest margin value in-between the two elements, if their top/bottom margins are adjacent and no text, clearance, padding nor border separate them.

»
Author's profile picture Nicu Surdu in #web

How to Set a Variable in Django Template

As you may have figured by now, Django does not implement such a feature. That is, because the logic of setting the variable must go in the view, not in the template. But there are some rare cases when you actually need this.

»

Capture the Output of a Django Command

The documentation is very slim when it talks about how to call a Django command from code. In order to do this, just use call_command. To solve the trick of capturing the output of this I had to dig a little into the Django source.

»

How Does Shazam Work ?

What is Shazam, you may ask ? Let’s say you’re in a bar, and they play a song that you like and you don’t know its name ? Shazam can help you find out what is the name of that song.

»
Author's profile picture Nicu Surdu

Make LineString Resolution Depend on Zoom Level in OpenLayers

So, you want to render a route on your OpenLayers map. Everything will be nice and sweet until you’ll have to render a huge route, in which case no matter what computer your clients have, most probably it will stall. To solve this you have two possibilities: you either reduce the number of lines you send from the server or you reduce the number of points rendered directly on the client’s browser.

»
Author's profile picture Nicu Surdu in #web