Arch Linux on Lenovo IdeaPad Y700 15”

| Comments

Collection of tweaks that I gathered after installing Arch Linux on to Lenovo IdeaPAd Y700.

Arch Linux on Macbook Pro 8.2 (17” 2011)

| Comments

Couple of tips from my experience of running Arch on Macbook 8.2.

Nvim Terminal + ClojureScript and Figwheel

| Comments

This is a small post on how to improve your ClojureScript development flow in NeoVim using its terminal feature.

ServerSide Rendering of Reagent Components

| Comments

Great thing about React is that you can write what people nowadays call “isomorphic JavaScript”. In this post we will not discuss how wrong this term is in many ways, but instead we will focus on how to achieve similar results in your ClojureScript code using Reagent library.

Ln -sf /usr/bin/emacs /usr/bin/vim ?

| Comments

Some time ago I actually did run ln -sf /usr/bin/emacs /usr/bin/vim. And left it like that for a couple of days. I must say that it was surprisingly nice experience. Tinkering around with elisp, building editing environment from scratch.

Of course interesting question is “How did I end up with this idea in my head?”.

Grench Binary for OpenSUSE

| Comments

Grenchman is a small tool that runs leiningen tasks over nrepl. Helps with JVM startup time during development. Build in OCaml. If you are not in to the building binary on your own, there are pre-build binaries on the official website.

And here is one missing binary for OpenSUSE (tested on 13.1, fedora binary does not work).

grench-opensuse [sha1 | sig]

Two Way Data Bindings in Reagent

| Comments

Small code snippet showing ability to generate 2 way data bindings in Reagent. Underneath it’s all about core.async. Also provides ability to apply transformation using transducers.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(defonce form (atom {}))

(defn bind-input
  "Generat on-change callback,
   bind value to form-key of form-atom.
   Provides ability to implement transformation using transducers."
  [form-atom form-key xform]
  (let [local-chan (chan 1 xform)]
    (go-loop []
      (swap! form-atom assoc form-key (<! local-chan))
      (recur))
    (fn [event]
      (put! local-chan
            (.-value (.-target event))))))

(defn bound-input
  "Generate input,
   create two way data binding
   between input value and value under form-key in form-atom.
   Provides ability to implement transformation using transducers."
  [attrs form-atom form-key xform]
  [:input (merge attrs
                 {:value (form-key @form-atom)
                  :on-change (bind-input form-atom form-key xform)})])

(defn main-component []
  [:div
   [:h3 (:name @form) " value"]
   [bound-input {:type :text} form :name (filter #(> 15 (count %)))]])

(reagent/render-component [main-component]
                          (js/document.getElementById "content"))

Replacing Shell Scripts With Clojure+JamVM

| Comments

We all hate shell scripting. Scripts are annoyingly hard to debug, test and verify. Would be lovely, to use some kind of lisp for scripting, right? To do interactive development with repl in your favorite editor. To write it in a nice predictable language that you also enjoy. But sometimes it’s impossible to add some external dependencies to the system. What if you have only JVM to your disposal, will you be able to pull it off only with JVM and clojure.jar?

Building Hacker News Json Api With Haskell

| Comments

Small announcement post.

Today I launched tiny scotty server that serves json for Hacker News front page. Project source code is located on github. You can access api here.

Hacker news parser is implemented using HXT and HandsomeSoup. Json is served with help of Scotty web framework. Currently it’s running on Heroku using this ghc-7.8 buildpack.

I don’t use RSS since I’m also interested in points and amount of comments. For me HN is more about interesting links than community and conversations behind the posts. So I don’t really care about anything except front page.

Originally I started this project as a Haskell learning exercise. I hope someone will find it useful.

Installing Spotify Linux Beta on OpenSUSE 13.1

| Comments

Very small post (more like insruction for myself for the future) on how to convert deb packages provided by Spotify to rpm. Solution can be applied to any rpm based system (I think so).

And it should work. I noticed few warning about default locates and missing libraries, but client still works fine without any changes to system (symlinks, locales and etc).

PS

If you have issues with volume being too loud by default make sure that you changed flat-volumes from yes to no in /etc/pulse/daemon.conf

PPS

People reported that installing version 0.9 -> uninstalling it -> installing version 1.0 might break your system. So watch out for the uninstallation errors.