-
Minimalist phone launcher
For the past few years I’ve been trying to focus on having more mindful experiences in my life. I find it rewarding to be present in the moment, without my thoughts rushing onto whatever awaits me next.
I present to you the biggest distraction: my phone.
I use to get in touch with people I love. I’m more productive at work because I have access to information on the go. I also use my phone to browse Reddit, YouTube, and every other media outlet imaginable. Even worse, sometimes I just waste time tinkering with the settings or mindlessly browsing through the apps I have installed.
It’s an attention sink.
Nearly a year ago as I was browsing the Google Play Store I bumped into a new launcher: KISS. The tag line caught my attention: “Keep It Simple, Stupid”. I went ahead and downloaded the launcher. I haven’t changed to another launcher since.
Here’s how my home screen looks today:
There’s nothing besides a single search bar. The search bar takes me to the apps I need, web searches I’m interested in, or people I’m trying to reach out to.
It’s simple to use. Start typing an app or a contact name, and the results show up above the search bar:
This simple concept has been responsible for cutting hours upon hours from my phone usage. Opening an app becomes a more deliberate experience, I open my phone with a purpose (granted this purpose might be to kill hours looking at cat videos). There’s no more scrolling through everything I have installed just to find something to stimulate my attention for a few more seconds.
You can download the KISS Launcher for Android from Google Play Store.
-
Making a packing spreadsheet
Being the unique person I am, I love traveling. Oftentimes I end up getting deep into trying to optimize my packing methods. There are dozens of tools online designed to help with this exact thing (services like Lighterpack or GearGrams). But, being handy with code, I decided to dabble in the subject on my own.
One of the most important things in packing is the overall weight of the pack, and I always want to know what type of things are the heaviest. I also want to be able to run random queries on my data, whatever it is that I’m trying to learn. I want to have an inventory of items (backpacks, clothes, storage solutions) which I can plug in and out of a spreadsheet to see how the resulting picture changes on the go. Working with software as my day job, I’d also like for the solution to be automated whenever possible.
Google Spreadsheets turned out to be the perfect solution, providing the ability to quickly sum up the weight of my things and output insights about the data.
Final Result
Here’s a link to the spreadsheet, I encourage the reader to copy and play around with in anyway you see fit.
Here’s the final result for a multi-day trip I will have for this year. As you can see, my pack weighs around 3 kilograms or a bit over 6 freedom units (not including water). My recently purchased Nintendo Switch is the heaviest item (and it’s worth every gram as it makes flying tolerable), but clothes take up most of the weight:
I use indentation levels to show that some items are contained within other items. This also lets me calculate the absolute and relative weights of a whole container with everything inside of it (see fields labeled “Container” and “Percentage”).
The “Weight” and the “Breakdown” fields indicate absolute and relative item weight respectively, which accounts for quantity of the item (quantity defaults to 1 if not explicitly set). Weight-related fields are color coded from lightest items in green to heaviest items in red.
Categories are used to group items and execute queries on the data and learn insights like these:
There’s a separate sheet where I enter item names, categories, and weights, which I then use to automatically populate values above and autofill item names in the primary sheet:
The Technical Details
I haven’t worked with Google Spreadsheets (or Excel for that matter) a lot in the past, but with an access to clear documentation (and a hundred of web searches later) it was straightforward to get the hang of the it.
I started off by manually populating the final result sheet, manually adjusting formulas for Container/Percentage cells, as I had no idea how I would detect the indentation yet. I like when things look pretty, so I applied conditional formatting rules right away, and the looks of the sheet really haven’t changed throughout the process.
Next, I created an inventory sheet, which I wanted to use as a source of data in the resulting sheet. A few Google searches and some trial & error resulted in a lookup formula:
=ArrayFormula( IF( NOT(ISBLANK($B2)), INDEX(InventoryCategories, MATCH($B2, InventoryItems, 0)), IF( NOT(ISBLANK($C2)), INDEX(InventoryCategories, MATCH($C2, InventoryItems, 0)), INDEX(InventoryCategories, MATCH($D2, InventoryItems, 0)) ) ) )
ArrayFormula
is necessary in order to create arrays on the fly without printing intermediate results in the spreadsheet.InventoryItems
andInventoryCategories
are named ranges referring to item names and categories in the inventory sheet.MATCH
finds an index of a first occurrence of the item name in the sheet, and retrieves corresponding category name. An item weight is retrieved by the exact same principle.Trying to find the container weight took a lot more time, and resulted in a lot more headache. Solution for handling indentation in Google Spreadsheets wasn’t as elegant as I would have hoped for, but it got the job done:
=ArrayFormula( SUM( $I2:INDIRECT( CONCATENATE( "$I", ROW() + IF( NOT(ISBLANK($B2)), MATCH(FALSE, ISBLANK($B3:$B), 0), MATCH(FALSE, ISBLANK($C3:$C), 0) ) - 1 ) ) )
The formula above finds the first non-empty cell in a column. It starts searching from the next row (for example, for an item on a second row, we look at the third row and below). After it knows which row first non-empty cell is in, the formula turns it into a string (column $I contains item weights) and use it as an upper bound of a sum of the weights. Finished formula is a bit longer (it adds sugar to only display the number when needed), and if you’re interested - you can look it up in the spreadsheet.
For example, in the screenshot above, the formula will start looking at cells in a column right after the “Packing cube”. As soon as it finds a non-empty cell (“Nintendo Switch case”), the formula will determine this row to be an upper boundary. The formula then will sum weights starting with a “Packing cube” row, and up to but not including “Nintendo Switch case” row.
The rest involved many small tweaks, adding pretty colors, hiding N/A errors and zeroes, and trying to find the perfect shade for column borders.
And, since you made it this far, here’s how the numbers above look in the real world:
Hopefully you found this useful, or at least somewhat entertaining. There’s a lot of room for improvement, and I aimed to provide a framework and a few basic ideas for building a spreadsheet to accommodate one’s twisted ultralight needs.
-
My .vimrc, annotated
I’ve been using Vim for anywhere between 5 and 10 years, and my
.vimrc
is all grown up. I use{{{1
to annotate folds in my.vimrc
, and usezM
to close all folds andzR
to open all folds (zc
,zo
, andza
respectively close, open, and toggle individual folds). The---
lines are simply cosmetic." => Pre-load ------------------------------------------------------------- {{{1 set nocompatible " Required for many plugins, ensures it's not compatible with " Vi, which nobody uses at this point. filetype plugin indent on " Great answer: https://vi.stackexchange.com/a/10125
Vundle is downright fantastic plugin manager. It allows one to install plugins with
:PluginInstall
and upgrade plugins with:PluginUpdate
. Simple, easy, reliable. Of course you’ll need to have Vundle installed, which I normally have as a git submodule." Required Vundle setup. set runtimepath+=~/.vim/bundle/vundle set runtimepath+=$GOROOT/misc/vim call vundle#rc() " => Vundle plugins ------------------------------------------------------- {{{1 Plugin 'gmarik/vundle' " The Vundle itself, to keep itself updated. " Colorschemes: Plugin 'NLKNguyen/papercolor-theme' Plugin 'ajh17/Spacegray.vim.git' Plugin 'altercation/vim-colors-solarized' Plugin 'squarefrog/tomorrow-night.vim' Plugin 'vim-scripts/ScrollColors' " Allows scrolling through colorschemes. " Language/tool integration and support: Plugin 'burnettk/vim-angular' Plugin 'fatih/vim-go' Plugin 'christoomey/vim-tmux-navigator' Plugin 'mileszs/ack.vim' Plugin 'motemen/git-vim' Plugin 'nvie/vim-flake8' Plugin 'pangloss/vim-javascript' Plugin 'scrooloose/syntastic.git' " Syntax checker. Plugin 'tpope/vim-fugitive.git' " Even better Git support. " Quality of life: Plugin 'EinfachToll/DidYouMean' " For typos during opening files. Plugin 'ciaranm/detectindent' " Automatically detect indent. Plugin 'ervandew/supertab' " Smarter autocompletion. Plugin 'junegunn/goyo.vim' " A plugin for writing prose. Plugin 'majutsushi/tagbar' " List tags in a sidebar. Plugin 'scrooloose/nerdtree' " A directory tree in a sidebar. Plugin 'tomtom/tcomment_vim' " Easy comment blocks with <Leader>cc. Plugin 'tpope/vim-abolish' " Extended abbreviation/substition. Plugin 'tpope/vim-repeat' " Intelligent repeat with '.' Plugin 'tpope/vim-surround' " Work with pairs of quotes/anything. Plugin 'tpope/vim-unimpaired.git' " Handy bracket mappings. Plugin 'tpope/vim-vinegar' " Enhanced directory browser. Plugin 'vim-scripts/DirDiff.vim' " Directory level diff. " New features: Plugin 'Lokaltog/vim-easymotion' " Easy navigation with <Leader><Leader>w. Plugin 'kien/ctrlp.vim' " Hit <C>p for a list of files/buffers. Plugin 'vim-scripts/Gundo.git' " Intelligent undo tree. Plugin 'vim-scripts/vimwiki' " A personal local Wiki. if v:version > 703 Plugin 'SirVer/ultisnips' " Intricate snippets. Plugin 'chrisbra/vim-diff-enhanced' endif " => Plugins configuration ------------------------------------------------ {{{1 " NERDTree: auto close if last window. function! s:CloseIfOnlyNerdTreeLeft() if exists("t:NERDTreeBufName") if bufwinnr(t:NERDTreeBufName) != -1 if winnr("$") == 1 q endif endif endif endfunction " Force Gundo preview to the bottom. let g:gundo_preview_bottom = 1 " Map Gundo. nnoremap <F5> :GundoToggle<cr> " DetectIndent: Enable and configure. augroup detectindent autocmd! autocmd BufReadPost * :DetectIndent augroup END let g:detectindent_preferred_expandtab = 1 let g:detectindent_preferred_indent = 2 " UltiSnips: Compatibility with YouCompleteMe via SuperTab. let g:ycm_key_list_select_completion = ['<C-n>', '<Down>'] let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>'] let g:SuperTabDefaultCompletionType = '<C-n>' let g:UltiSnipsExpandTrigger = "<tab>" let g:UltiSnipsJumpForwardTrigger = "<tab>" let g:UltiSnipsJumpBackwardTrigger = "<s-tab>" " VimWiki: default location. let g:vimwiki_list = [{ \ 'path': '$HOME/Dropbox/wiki', \ 'template_path': '$HOME/Dropbox/wiki/templates', \ 'template_default': 'default', \ 'template_ext': '.html'}] " Map Tagbar. nnoremap <F8> :TagbarToggle<cr> " Synastic configuration. let g:syntastic_always_populate_loc_list = 1 " Make :lnext work. let g:syntastic_html_checkers = [''] let g:syntastic_javascript_checkers = ['gjslint', 'jshint'] let g:syntastic_javascript_gjslint_args = '--strict' let g:syntastic_python_checkers = ['gpylint']
Most plugins above change slightly change daily Vim workflow: the way one navigates files, replaying actions, working with snippets, minor tweaks to editing - and I highly recommend at least skimming through README of plugins you’re interested in so you can incorporate the changes in your workflow.
I have a set of simple defaults I use everywhere, major changes being changing
:
to;
and moving my leader key to a spacebar. Everything else are tiny quality of life tweaks." => Editing -------------------------------------------------------------- {{{1 syntax on " Indentation settings. set autoindent set expandtab set shiftwidth=4 set softtabstop=4 set tabstop=4 " Disable backups and .swp files. set nobackup set noswapfile set nowritebackup " Semicolon is too long to type. nnoremap ; : vnoremap ; : " Map leader key. let mapleader = "\<Space>" " Use system clipboard. set clipboard=unnamedplus " Enable wild menu (tab command autocompletion). set wildmenu set wildmode=list:longest,full " Don't complain about unsaved files when switching buffers. set hidden " Make soft line breaks much better looking. if v:version > 703 set breakindent endif " Pretty soft break character. let &showbreak='↳ ' " => Looks ---------------------------------------------------------------- {{{1 set background=dark colorscheme spacegray " Set terminal window title and set it back on exit. set title let &titleold = getcwd() " Shorten press ENTER to continue messages. set shortmess=atI " Show last command. set showcmd " Highlight cursor line. set cursorline " Ruler (line, column and % at the right bottom). set ruler " Display line numbers if terminal is wide enough. if &co > 80 set number endif " Soft word wrap. set linebreak " Prettier display of long lines of text. set display+=lastline " Always show statusline. set laststatus=2 " => Movement and search -------------------------------------------------- {{{1 " Ignore case when searching. set ignorecase set smartcase " Fast split navigation. nnoremap <C-j> <C-W><C-J> nnoremap <C-k> <C-W><C-K> nnoremap <C-l> <C-W><C-L> nnoremap <C-h> <C-W><C-H> " Absolute movement for word-wrapped lines. nnoremap j gj nnoremap k gk " => Misc ----------------------------------------------------------------- {{{1 " Use Unix as the standart file type. set ffs=unix,dos,mac " Ignore compiled files. set wildignore=*.o,*~,*.pyc,*.pyo " Ignore virtualenv directory. set wildignore+=env " Fold using {{{n, where n is fold level set foldmethod=marker " => Fixes and hacks ------------------------------------------------------ {{{1 " Ignore mouse (in GVIM). set mouse=c " Fix backspace behavior in GVIM. set bs=2 " NERDTree arrows in Windows. if has("win32") || has("win64") || has("win32unix") let g:NERDTreeDirArrows = 0 endif " Increase lower status bar height in diff mode. if &diff set cmdheight=2 endif " Unfold all files by default. au BufRead * normal zR
I have some custom commands and shortcuts I’m using, but not too many. I find that I mostly just forget to use shortcuts I make, and I end up deleting lines from this section regularly.
" => Custom commands ------------------------------------------------------ {{{1 " Trim trailing whitespace in the file. command TrimWhitespace %s/\s\+$//e " Command to close current buffer without closing the window. command Bd :bp | :sp | :bn | :bd " => Leader shortcuts ----------------------------------------------------- {{{1 nnoremap <Leader>] <C-]> " Jump to ctags tag definition. nnoremap <Leader>p :CtrlP<cr> " Fuzzy complete for files. nnoremap <Leader>t :CtrlPTag<cr> " Fuzzy complete for tags. nnoremap <Leader>r :redraw!<cr> " Redraw the screen (for visual glitches). nnoremap <Leader>w :w<cr> " Write a file.
Hope you find this useful and take away a few bits and pieces for your own workflow.
-
Automating Octorpress publishing
I really like Octopress. It builds on top of Jekyll to address certain rough edges, and provides ready to go lighting fast blogging platform. It’s easily extendible if you know how to code (thanks to a rather clean and well organized code base), and posts are just plain Markdown files.
One issue though - I need to be near a computer to publish and preview the article. This becomes difficult if I’m traveling with, say, a tablet.
I have a low end AWS Lightsail instance I use for writing and publishing, but it’s not always fun to write when SSHing into a server, and I often write offline - making it even more difficult to move files between where I write and where I publish. And managing images is a nightmare. To resolve this, I set up a few directories I use in Dropbox, and wrote a few scripts to move things around when needed.
Here’s a directory structure in Dropbox:
- blog/ - posts/ - 2017-11-20-automatic-octopress-publishing.markdown - img/ - input/ - a-picture-of-a-flower.jpg - output/
I put Markdown files in
Dropbox/blog/posts/
(and numerous offline editors sync with Dropbox - I’m writing this with StackEdit, and I use iA Writer on my tablet). I add my images toDropbox/img/input/
. I tend to strip metadata from my images and resize them to fit the maximum page width (I don’t really care for high resolution pictures, speed is preferred over ability to zoom into a picture). For this, two tools are needed:sudo apt-get install imagemagick exiftool
When I’m done writing or want to preview an article, I SSH into my AWS Lightsail instance and run
sync.sh
, a small script which moves posts to a proper directory, processes images and places them in the desired location, as well as starts Octopress instance (this way I can preview my blog on the AWS Lightsail instance). Contents ofsync.sh
(don’t forget tochmod +x
):#!/bin/bash cd $HOME/Dropbox/blog/img/input mogrify -resize 832x620 -quality 100 -path $HOME/Dropbox/blog/img/output *.jpg exiftool -all= $HOME/Dropbox/blog/img/output/*.jpg cp $HOME/Dropbox/blog/posts/*.markdown $HOME/blog/source/_posts cp $HOME/Dropbox/blog/img/output/*.jpg $HOME/blog/source/images/posts cd $HOME/blog rake generate rake preview
I run the above script every time I want to preview the site. I’m sure it’s easy to set up a daemon to watch for changes in the Dropbox folders, but I don’t see the need for that yet. Also, I just statically resize images to a particular resolution (832x620) since all of the pictures I upload have the same aspect ratio, I’m sure there’s a way to calculate that number on the fly for this script to work with different aspect ratios.
Lastly, when I deployed and committed my changes (still commit and deploy manually out of a habit), I run
archive.sh
:#!/bin/bash mv $HOME/Dropbox/blog/posts/*.markdown $HOME/Dropbox/blog/published rm $HOME/Dropbox/blog/img/input/* rm $HOME/Dropbox/blog/img/output/*
It’s not much, but enough to save some manual labor involved in publishing to Octopress.
-
A trip to Salt Lake City
This article is a collaboration between my partner and I.
Since moving into a studio, I have missed the freedom of taking off randomly, getting to know a different city or state and overall not being tied down to a routine or a location. I love the idea of trivializing travel, so it was only natural to have a random trip at the end of the week.
My partner watches The Bucket List Family on a weekly basis and caught the traveling bug as well. Unfortunately, we are not yet at the level where we can afford a 5 star trip to international locals or have companies pay for our travels (one day!). Our goal was to spend a few days going out of state to break the work week and avoid living for the weekend.
We decided to leave Northern California on Thursday afternoon for Salt Lake City, Utah as soon as we were done with work. Roughly 800 miles each way, if one counts exits and driving around sightseeing. Inspired by an acquaintance who travels the world with a folding bike, my partner and we took our bikes with us: a borrowed Brompton folding bike for my partner in the back seat, and my ZycleFix Prime mounted on the rack in the rear.
Driving through California, Nevada, and Utah on I-80 was always one of my favorites - and it was nice to share the wonders of the world with my partner. She clocked in a lot more international travel than I did, but only been to a handful of states. It was her first time in Utah and each stop on the way to the Salt Flats exposed us to all kinds of people, different from the type of individuals we typically see inside the Silicon Valley tech bubble. We saw people with different lives, habits, hobbies, and worldviews, which to be perfectly honest, was refreshing.
Throughout the trip, we made it a point not to make any plans and go with the flow – be it our driving pace, entertainment or food options, or cities we decided to stay the night in. Traveling that way removed the stress associated with finding the perfect location and planning a fun trip. Don’t like the town we stopped at? Let’s keep driving. Enjoy a specific city? Let’s spend the night there. Having issues at a hotel? Back on the road we go.
We found a hotel while driving on the I-80 and settled there for the night. Unfortunately the place did not have a strong enough WiFi, which led us to drive to the next town over for coffee and internet to work remotely. We ended up spending 6 hours in the coffee shop making sure that we kept ourselves well caffeinated and the servers well tipped. After a somewhat productive day, we decided to explore the city’s downtown and save the Salt Flats drive for the daytime.
Our Super 8 Motel in Wendover cost us around $70 for the night and was more comfortable than expected. We ended up passing out as soon as we got to the room, exhausted from the day. We tried to stay at cheaper hotels/motels, while avoiding shady looking places. We would most often pick the 2nd or 3rd cheapest option. We never stayed in one place for more than a night and lucked out every time we got ourselves a room. Every room we slept in was clean and we even managed to squeeze in a daily workout before the start of each day.
Keeping a healthy diet on the other hand was a whole other challenge. Between cafes, restaurants and late night cravings, we failed at maintaining proper eating habits and saving on food. We spent around $300 on food alone. Eating is definitely one area for improvement, especially as we decide to travel more. Dieting is hard and dieting on the road is even harder.
On Saturday, we finally headed to Utah and stopped at a rest stop by the Salt Flats. The view was marvelous and cold for an October day. We left the Salt Flats for a mall, City Creek Center, in Salt Lake City where we had another amazingly delicious and unhealthy lunch. To feel better about our life choices, we used our bikes to get some cardio and discover the city on two-wheels. We biked through Memory Grove Park, crashed a wedding, and biked almost to the Capitol. Almost. Due to Salt Lake’s incredible, deadly hills. Next time, SLC, next time we shall conquer you.
After a day of biking and testing each other’s patience, we decided to go for a date night and talk through our attempts at making life on the road work. Traveling solo is a very different experience than traveling with a partner. We chatted over Brazilian BBQ, another unhealthy choice, and agreed that we needed to include time alone as part of our travel routine and constantly check in with each other.
We headed to the hotel and decided to leave back for California after breakfast on Sunday. Oh, and on the topic of car, the subject of staying in the Prius or camping came up a few times. We even prepared our tents in that event but the cold weather and the thought of a hot shower took priority… Oh well, hotel Prius will get more use some other time.
In one day, we drove from Utah back to Northern California. We have different memories of the road back. For her, it was long and slow. For me as a driver, it passed within a blink of an eye. Overall, our trip to Utah was a success and we learned a lot:
- Nothing can replace the freedom associated with the absence of a plan. When there’s no agenda or times to be at specific places - you’re never late, never in a hurry, and you’ve always seen more than you planned for. It allowed us to be surprised and delighted by places we encountered without imposing our pace on said locations.
- Taking time for oneself is a necessity when traveling with someone else. Time alone does not always mean actually being alone. It can be whatever works for you as a couple. For us, it’s spending time on our devices while sitting next to each other.
- Approaching each location with an open mind. You are not always going to get to travel to exotic places like the Bahamas, but the opportunity to fall in love with a place or its people is always there.