Love letter to future me
HugSQLx - SQL queries turned into Rust functions
The Clojure community is fortunate to have HugSQL - a brilliant library that simplifies working with SQL. HugSQL separates queries from the code, preventing them from cluttering .clj files and transforming them into plain Clojure functions within a namespace. These functions are quite intelligent; the underlying magic connects to PostgreSQL, SQLite, or any supported database via JDBC, executing defined queries with the provided function arguments.
Simple, yet remarkably effective…
Can we achieve something similar in Rust?
Boot-ize your project
Maven or gradle? Grunt or gulp? Leiningen or boot…?
It doesn’t matter whether you’re a front- or back-end dev, sooner or later you have to complete your toolbox and choose a right hammer for the right nail. The problem is, all these tools in our ever changing programming world rotate so fast and details between them become so subtle that you’re barely able to check all of them out, understand the philosophy behind and take a reasonable decision. In particular it’s noticeable in javascript world where new ideas emerge with the speed of light. Do you know what’s the usual lifetime of shiny new javascript library, one of 4 hundreds coming out daily? Well, I don’t know too but I guess you wouldn’t be able to complete a todo app before the library of your choice became deprecated :)
Emacs Windows Switching
It takes a few days for beginner Emacs user to learn what’s the difference between windows and frames. Then usually next question arises: how to switch between multiple windows within same Emacs frame?
The most obvious way is to use mouse/touchpad of course. It’s easy at the beginning but horribly distracting in a long term. Emacs unfortunately doesn’t really help with its crazy default shortcuts. There is C-x o described as “select another window” which cycles through all available windows. Well, good luck with selecting windows this way longer than a day.
Clojure for fun & profit
This is my initial blog note - first from series I’m going to write about one of the most innovative programming languages we can hear of nowadays - about Clojure. New incarnation of almost forgotten Lisp came back onto scene bending minds of thousands of programmers who suddenly discover again the joy of programming.
Lot of arcticles have been already written about Clojure and why it’s so attractive. Not to repeat all of these oh’s and ah’s I would like to sum up things most important for me as a long-time professional java programmer:
Swank JS
Have you ever wanted to modify your browser’s content directly from a text editor?
Episode 11 of Emacs Rocks shows how swank-js can seriously speed up your web development workflow. If you haven’t added Emacs Rocks to your RSS reader yet, I highly recommend it - it’s a great source of tips and tricks for daily Emacs use.
So what is swank-js? As its GitHub description says, it provides a JavaScript REPL (read-eval-print loop) connected to your browser via Socket.IO. In practice, this means any JavaScript expression you type in the REPL immediately affects the page you’re connected to. Better yet, you don’t even need the shell - you can send code and CSS to the browser directly from your working buffer.
TypeRacer: Find out how fast you really type
Javascript programming
Be social
Emacs isn’t only a best-class editor which offers you productivity boost for free. It’s also all-in-one environment which embeds most frequently used tools like console (eshell), irc (erc), news reader (gnus) and… well known “social” gadgets like gtalk and twitter. Yes, that means, you may communicate with friends and check your tweets not even leaving editor window.
Let me show how to configure both.
GTalk
Gtalk bases on open protocol (jabber), so the only thing we need is a jabber client. Looking at emacs wiki you will easily find this one along with exhaustive documentation.