Run, Developer, Run!

System Wide Snippet Expansion Ubuntu

Unicode symbols (like x ) look nice, and we should use them more often. But typing them is not fun at all. Either you need to remember long numeric codes or take hands from keyboard to do multiple mouse clicks. Ligatures have right idea that -> should be converted to , +- to ± etc, but whats the point of it, if only selected apps with rare font are able to show them?

On another topic, I hate to type long words like "unfortunately" and "successful" and always make mistakes in them. So I want to autocomplete them. And expand frequently used phrases like "Thank you".

So I suggest you to use global snippets which will work in any app like Slack, Sublime Text, Intellij Idea, Browser input fields e.t.c. As bonus script to do that is very minimalistic - it relies on simulating keyboard shortcuts to select, cut and paste text. Original idea by sessy, my version is heavily modified and have number of improvements.

Works like this:

  • Type ->, press hotkey, get .
  • Type 15eur, press hotkey, get 15€.
  • Type unf, press hotkey, get unfortunately.
  • Type thx, press hotkey, get Thank you.
  • ...

Read instalation, and add your own snippets:

Source on Github

Sublime Text Python Tips

Python 3 print autocompletion

Working with both Python 3 and Python 2.7 in Sublime? Can't make yourself used to type print with brackets? Put this simple snippet in your Sublime Text User Package directory. It will autocomplete print statement with brackets.

Bonus tip for Linux users. Tired to switch build system from Python to Python 3 and back? Just want to Sublime Text use shebang/hashbang when running Build (F7) command? I.e:

  • If your file starts with #!/usr/bin/python3 use Python3
  • If your file starts with #!/usr/bin/python use Python
  • If your file starts with #!/usr/bin/env python use default Python version
  • If your file starts with #!/bin/bash or perl e.t.c., run file defined app..

Put this simple build system in your Sublime Text User Package directory, then select Tools → Build System → Run, and you will have universal runner based on file first line.

Designer tip

Nice looking color scheme

So you are programmer and not designer, but need to highlight something by using different colors? Create scheme, graph or some kind of drawing? Please don't use bold default colors like RED #FF0000 GREEN #00FF00 and BLUE #0000FF, or your creation will look like something from nineties.

Just go to COLOURlovers Top where people with taste and free time created and evaluated color palettes, that just look nice. If you need more colors use Adobe Color wheel to find colors that match. Its quick and simple, but your work will instantly look stylish and professional.

Booting Ubuntu from USB External Drive on Macbook Air

Macbook Air Ubuntu

So I have that tiny USB 3.0 bootable 32GB drive, where I have copied (using dd) Ubuntu instalation from my workstation. It's very convenient to have it, as I can boot from it on any machine (even inside VirtualBox), and instantly get my familiar working environment1.

Story is,that recently I've tried this trick with Macbook Air, and was very disappointed - despite as Ive holded button firmly during boot, my awesome USB wasn't detected.

Thing is that my Ubuntu installation had BIOS boot mode, but Macbooks only support EFI boot.

If you Google that problem, you will find extremely complex solutions.

Here's much more simple one, which will not require any modifications in your Ubuntu installation, and it will still be bootable on computers without EFI support.

Read More →

Simple Hackable Pomodoro Timer

Pomodoro Timer Slack Status and Do Not Disturb

There are tons Pomodoro timers out there. But they are either not customizable, or have "Enterprise Architecture" with multiple methods and calls in the source code, making it complicated to quickly make changes. What if want to quickly customize timer for yourself?

You may want to:

  • Score Habitica habits on completed or canceled Pomodoros
  • Set Slack to "do not disturb" mode while Pomodoro is running
  • Set Tomato Emoji as Slack status, so your colleagues get that you are "trying to concentrate"
  • Update Beeminder to match goal of completing n Pomodoros per day
  • Change color to match your favorite breed of tomato
  • ...

So I've created one more Pomodoro timer. Less than 50 lines of *very simple cross-platform1 Python script. By default, it displays "always on top" window with a timer in window and title.

Source on Github

The code has no options, as its self-explanatory and intended to be hacked and modified to fit your specific vision of how Pomodoro timers should work. Read More →

Proper way to create alert box in Markdown

Sometimes, especially when writing documentation, you might want to put text in a nice colored box. To highlight info, notes, warnings, alerts etc. Like this:

Markdown colored alert box

The problem here is that there no such tag in markdown. So your only option is to use html or macros. As markdown is not processed inside html tags and following code:

<div class="note">       
    **NOTE**: Source [here](//

Will look like this:

Markdown warning

So you either need to make all text inside warning box html (which is ugly and inconsistent) or look for a better solution. Read More →


If you wake up from amnesia, and found yourself near computer, first thing you need to type is whoami. After that, you probaly want to type history to recall whats happened. Third logical question would be whereami, but unfortunatelly command does not exist by default. So prepare yourself to sudden amnesia now, and add to your aliases:

alias whereami='curl'

It will show your ip and location. Also useful to check which VPN are you using.

More Bash and Fish goodness.

Adding ToDos to Wunderlist via Fish Command line

(With human readable dates and autocompletion!)

Wunderlist is good GUI tool when you need todo organization, sharing and access from multiple devices. But for speed I want to add todos via command line, and allow scripts to do that for me.

If you Google "Wunderlist CLI", you will get solutions on Ruby and Nodejs. Nope, does not sound right for small CLI utility. Found good one written in Go - wl, but it intended as raw API, and there could be some user friendly improvements. For example you need to address lists via numeric id, and have to write date in defined format.

So I've created wrapper to make it more quick and convenient to use. Works like that (with tab completion and autosuggestions):

todo buy raspberry pi --life --on next monday
todo do code review --work --star
todo --work meet customer --on jan 7
todo visit mars --goals --on 2020-01-01
todo return books --on 3 days

Wrapper is written in Fish, because I wanted to try its syntax. Fish scripts are less bulky and more readable than Bash ones, but argument parsing is still a bother. So I've used lazy approach - check argument string for words using contains. Then remove all words starting with "--" by regexp. In my opinion result looks more clean.

I've also used lazy (but universal) approach to generate argument completion - search script source for strings starting with "--" and add them to Fish completion as arguments for todo command. Fish autosuggestions works greatly in this case - if you ever typed routine todo, fish will suggest completion next time.

Did you know that GNU Date understand human readable dates date --date="next Friday"? Cool! So script assumes everything after --on argument is date, so make sure it goes last in cmd. If date fails to interpret date it will save todo as todays with date in title, so you will be able to correclty set it manually later.

For installation read script header

Source on Github

How to download latest release from Github

Sometimes you might want to download latest release of binary from Github repo using script. You can do this using API, but lets assume that on some enviroments you have only basic tools, and no jq to extract values from JSon.

  1. Git hub has built in redirect, i.e. which redirect to page dedicated to latest release
  2. We can get redirect url with curl, i.e. curl -Ls -o /dev/null -w "%{url_effective}" will get us
  3. Now we can extract version by using basename, i.e. basename will return 0.15.9
  4. Using this version we can construct download url.

For example script that downloads and installs latest version of fzf

    export FZF_VERSION=$(curl -Ls -o /dev/null -w "%{url_effective}" | xargs basename)
    curl -L$FZF_VERSION/fzf-$FZF_VERSION-linux_amd64.tgz | tar -xz -C /tmp/
    sudo mv /tmp/fzf-$FZF_VERSION-linux_amd64 /usr/bin/fzf

Protected Text Backup

I really like service ProtectedText.com1. Its convenient way to store encrypted text and keep easy access to it, as notes are editable in browser, and can be opened from any device. Keep non-critical passwords there, or use it to share credentials.

Url is protected by https, encryption is done on client side (in your browser), and they keep code readable so you can review it yourself.

Only concern I have, that this nice service may be closed one day.

So I've created Script to backup ProtectedText


  • Can backup multiple secrets
  • If file is changed, keep previous version with date postfix
  • Only backups once per day
  • On success pings so you'll be notified in case something goes wrong.

Files Can be decrypted using commandline:

base64 -d BACKUP_FILE | openssl aes-256-cbc -d -k PASSWORD

Source on Github

←Prev 1 2 3 4 5 6 7 8 Next→



Me on Twitter, Mastodon and Github

We have RSS!

© 20xx

Hosted on Cloudflare Pages, which is awesome!