Garlic.js — automatically persist forms until submission

Everyone hates when something happens to that huge web form they were filling. Accidentally closed a browser window? Pressed a Back button? Computer crashed? “Arrgghh, have to fill the form again!” — says your user… or just leaves your website. If you don’t want this to happen, Garlic.js is here to help you!

Continue reading Garlic.js — automatically persist forms until submission

Minimize PNG files using lossy compression

Unlike JPEG, PNG is a lossless image format, which is why it reproduces pictures perfectly, but makes many of them — mostly photographs — much larger than what you’d get with lossy codecs. PNG is also the only way to get pictures with transparency (alpha channel) display in all browsers, so if we need images with alpha channel, we have to use large PNGs. However, there’s a little trick we can use to make them smaller: by applying lossy preprocessing.

Continue reading Minimize PNG files using lossy compression

snabbt.js — minimalistic JavaScript animation library

Snabbt.js is a new simple and fast JavaScript animation library. It is minimalistic — 4 KB (minimized and gzipped) — and according to its author, focuses on “things that modern browsers can animate cheaply: transforms and opacity”. Snabbt uses CSS3 transforms for animation.

Continue reading snabbt.js — minimalistic JavaScript animation library

Optimizing JPEG images with MozJPEG

MozJPEG is a project from Mozilla aimed to improve JPEG compression while keeping full backwards compatibility with current decoders. Recently they released version 3 of the library. Previous version reduced files by 5% on average compared to jpeg-turbo, the JPG compression library it is based on. The new version contains more improvements, such as reducing compression artifacts for text on white background, and better quality for high-resolution images.

Continue reading Optimizing JPEG images with MozJPEG

Gogs: setting up self-hosted GitHub clone

Forget scripto-Perlo-C porridge to setup web interface for Git! Forget installing thousands of dependencies to setup your own repository hosting! Gogs is here to make your life easier!

Gogs is a GitHub clone written in Go, which you can host on your own server. It’s a web interface to Git repositories plus a simple bug tracker. Gogs is very easy to install and use.

Continue reading Gogs: setting up self-hosted GitHub clone

Bolt — an embedded key/value database for Go

If you want data persistence in your Go application, most likely you’re thinking of using some database. The easiest and probably the most convenient for deployment are embedded databases. There are many wrappers for C databases, however Go developers usually prefer pure Golang solutions.

Bolt is the way to go: it’s a pure Go embedded key/value database, which is easy to use for persistence in your Go projects. Bolt is similar to LMDB, which many consider the best among state-of-the-art modern key-value stores. Just like LMDB, and unlike LevelDB, BoltDB supports fully serializable ACID transactions. Unlike SQLite, it doesn’t have a query language, and is much easier to use for common things.

Bolt saves data into a single memory-mapped file on disk. It doesn’t have a separate journal, write-ahead log, or a thread for compaction or garbage collection: it deals with just one file, and does it safely.

Continue reading Bolt — an embedded key/value database for Go