In Y Soft, there is a group of Clojure fans (including myself) that are fool enough to participate as contestants in Clojure cup and we are looking forward to see you there as well!closure-cup

Clojure cup is a world-wide competition where you develop a Clojure or ClojureScript application in 48 hours and then being judged by some of the big names from Clojure comunity, including Craig Andera, Reid Drapper, Michael Fogus and others. The competition starts on Sept 27th 0.00 am UTC, which means it will start at 2.00 am local time (Czech Republic). You must do all your work during 48 hours without any previous code prepared, however, you can use any publicly available libraries (including your own).

We are considering using Clojure stack on our next products and think this is a great opportunity to both, test the suitability of Clojure on real world application and deepen our knowledge of the language and platform in general. We already have a complete team of four people, but if you are looking for spaces where all your team could meet and stay near Brno, definitely get in touch with us on our twitter – @ysoftdevs and we could all meet at our beautiful HQ offices.

See you there and good luck to all of us. We are looking forward to see your great applications.

You made changes in your repository. You made the commit and at the very same moment you realize that it’s not completely correct.

You need to fix the last commit.

Git provides possibility to amend last change.

Type command for git gui interface:

git gui

git-gui

Click radio button Amend Last Commit.

git-ammend

You can change the commit message or remove staged item by double click.

git-gui-unstage

When you made all necessary changes click Commit.

git-commit

Virtual environment is essential component of Python world. You can isolate different version of packages into separate environments.

How to set up virtualenv?

Install Python and virtualenv package by pip:

pip install virtualenv

python-insltall-virtualenv

Create directory which will hold the virtual environment (e.g. pyenv34) and initialize it:

virtualenv --system-site-packages pyenv34

python-setup-virtualenv

You can uses system-site-packages option to tell virtualenv to inherit system packages from system installation of Python.

The next step is to activate environment:

.\pyenv34\Scripts\activate.ps1

pyenv-activate

Your command prompt will change and you will see the name of virtual environment in the command line.

Now you can install, uninstall packages by pip and everything will be isolated in the virtual environment directory.

E.g. install ipython

virtual-env-use

It’s time to import antigravity 🙂

pyenv-antigravity

Shells like Bash or Zsh have one neat feature: repeat last command.

How to invoke it? Use double exclamation mark:

!!

This is very handy when you have typed the command as normal user, but it must be executed by sudo.

Example:

apt-get install safeq
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)

Execute the same command with elevated privileges:

sudo !!

Sometimes it is necessary to work only with text console.

Git provides rich command line interface, but browsing history is little bit cumbersome.

If you like command line tools and email client mutt then there is awesome tool for you: tig.

tig is text mode interface for git.

Just enter directory with cloned git repo and type:

tig

tig-example

Quick navigation:

  • Enter – show details
  • Tab – switch window pane
  • q – quit

You can find more information at http://jonas.nitro.dk/tig/manual.html.

This tool is available for Mac and Linux. Windows version is available in Cygwin.

Sometimes it is necessary to modify several places in text file at once.

Sublime Text has very neat feature: multiple cursors.

Point mouse cursor at desired text location, press CTRL and left click. You can repeat this operation several times.

sublime-before

You’ll see multiple cursors and as you start typing all cursors will perform the same operation.

sublime-after

Gradle requires Java and it can reuse all great features from the runtime. The drawback is that it takes several seconds to boot whole Groovy/Java engine after typing command: gradle.

There is simple way how to speed up Gradle: use daemon mode.

The easiest approach is to put following line into file ~/.gradle/gradle.properties:

org.gradle.daemon=true

Gradle will automatically spawn daemon process after the first execution of command gradle.

gradle-java-process

Every build is starting faster.

That’s nice, but daemon is sitting in the memory. You can shut down daemon by command:

gradle --stop

Interesting option for developers is to leave daemon in running in foreground and watch daemon in debug mode:

gradle --foreground --debug

More detailed info about Gradle daemon is available in Gradle manual.