Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@tiegz
tiegz / shell_spinner.rb
Created June 1, 2011 21:39
A ruby helper for printing out ongoing progess (for shell).
module Kernel
# Prints out progress
@@printp_spinner = %w(⇐ ⇖ ⇑ ⇗ ⇒ ⇘ ⇓ ⇙)
@@printp_spinnerpos = 0
@@printp_cols = [`tput cols`.to_i - 20, 50].max
def printp(symbol, i)
print @@printp_spinnerpos % @@printp_cols == 0 ? "\n" : ("\b" * (16 + symbol.size))
print "#{symbol}#{" %3d%" % i} complete #{@@printp_spinner[(@@printp_spinnerpos+=1) % 8]} "
STDOUT.flush
end