Monthly Archives: March 2016

tsatter.com

tsatter.com is what resulted from me wanting to make a website, and take it far enough to call it finished. I learned a lot along the way. Here’s a short description of the whole system. I’ll write more specific posts and link them here when I find the time and interest. Requests for speeding up a specific part are of course welcome.

  • Dockerized environment for easy development and deployment
    • Provided you have docker installed, it takes executing one command to have the whole 5 part infrastructure set up for you.
  • NGINX
    • efficiently shares static files
  • NodeJS
  • IRC server
    • handles actually delivering messages between users in channels, and keeps track of channel’s ops etc.
    • provides a tried and tested protocol for bots to interface with.
  • AngularJS front-end
    • infinite scrolling front page
    • infinite scrolling messages
      • clicking the timestamp gives a shareable url. Opening the URL will take the opener to that message, and highlight it.
      • no need to load the whole history at once
      • handles massive amounts of lines without slowing the computer much
    • infinite scrolling images
      • images have a link to the message in which they were linked
    • inline image search & linking (by pressing @ in a chat)
    • kicking/oping/unoping users in a channel

It used to have registering and logging in as well at a time, but I wanted to make starting using it as easy and low effort as possible. But now I’m thinking maybe sending those post registration spam emails would help with user retention and actually getting users back to it after they’ve tried it once.

Linux productivity

 

I used to install Linux on a whim, and when I couldn’t reach the level of productivity I was used to in Windows (since I had been using it for so many years), I’d go back to Windows in a few weeks. What finally changed this and made Linux my favorite OS to develop in was i3(wm). Here’s a couple other productivity tips:

Vim

  • `vim -p file1 file2 …` opens multiple files in tabs in vim. With zsh expanding regex, `vim -p ./*` opens all files in your current directory as tabs in vim. `vim .`  browses the current folder using vim
  • use `:! <bash command>` like `:! ls` to run normal bash commands from vim and see the results in that window.
  • Use Awesome vimrc‘s awesome version as a base of your .vimrc if you don’t already have one. Also find the super pretty `wombat256mod` color scheme somewhere, put it to ~/.vim/colors/  and add a `set colorscheme wombat256mod` to your ~/.vimrc.
  • After installing the awesome vimrc, add `execute pathogen#infect()` to your .vimrc, then you can install vim plugins just by cloning them from github to `.vim/bundle/`

Window manager / i3

  • Use a tiling window manager, like awesome or i3wm. I’ve never used awesome, because i3 is so awesome, but definitely give one of those a try. They’re actually the killer feature that made me stick with Linux for the first time. Neither Windows or OSX have anything as good as i3.
  • Change i3 directional keybinds to vim keybinds, since they’re by default  one-to-the-right-of-vim-arrows (jkl; instead of hjkl) which confuses the hell out of your brain when you use both vim and i3

General

  • use `xset r rate <time in milliseconds until key repeat starts> <repeats per second>` for example `xset r rate 200 40` to make scrolling around vim faster. The default speed limits are for old people.
  • use zsh and oh-my-zsh rather than bash. It’s so much better (case insensitivity, for one), and easy to use if you’re used to bash.
  • make a folder called dotfiles in your home folder, put the files you’d like to sync between installations there, version control it (I have a private Github repo for it), and symlink them from that folder to your ~/
  • Use `mosh` instead of `ssh` if you often work over high latency connections.
  • If you need to follow multiple log files when executing something in the command line, instead of having multiple terminals for logging or having a different split for each file in the same terminal, you can interleave the logs by opening each log file with `tail -f /tmp/logfile &` to the background. This way as the log entries come in, they’ll be in chronological order in the same shell.