How to Add Syntax Highlighting to Command Line Output

Posted on

install the Python syntax highlighter Pygments sudo apt-get install python-pygments choose an alias and assign the pygmentize command to it, customizing the style however you’d like alias catt=’pygmentize -O style=monokai -f console256 -g’ add the alias line to your bash startup file (.bashrc, for example) to have it available every time you log on enjoy…Continue Reading

How to Get Unix Time in Ruby

Posted on

get current unix time float since_epoch_float = Time.new.utc.to_f integer since_epoch_int = Time.new.utc.to_i get unix time corresponding to a specific date my_datetime = Time.utc(1979, 3, 7, 21, 0, 0) since_epoch_int = my_datetime.to_i get time object corresponding to a specific unix time my_datetime = Time.at(289688400).utc ​  

How to Build a Simple IoT System with Python

Posted on 2 Comments

IoT The Internet of Things (IoT) movement is in full swing and growing bigger every day. Wireless thermostats and refrigerators, home security systems controlled by a mobile app, scales and health monitors that save your weight and fitness data…these are some examples of the “smart” gadgets coming out of the IoT movement. This blog post…Continue Reading