New Album, Messengers Rising Available

I have a (somewhat) new album available, called Messengers Rising.

It was mostly inspired by a previous relationship of mine, as well as coping with being diagnosed with bipolar disorder.

You can stream it for free on all major services.

If anyone wants a lossless copy of the album, feel free to email me, and I'll send you a link in your preferred format. 

I hope you enjoy it!

Fish as Default Shell on Windows 10

Step 1: Install Fish

Because the Linux Subsystem for Windows 10 is a full Ubuntu operating system, all software packages available for Ubuntu are installable on your Windows machine now! Here's some simple steps to install the latest stable release of fish, the world's greatest shell:

$ sudo apt-add-repository ppa:fish-shell/release-2
$ sudo apt-get update
$ sudo apt-get install fish

Step 2: Make it your default shell

Everything in the Linux Subsystem for Windows 10 is oriented around Bash, so you have to tell bash to automatically launch fish at startup, by placing the following in your ~/.bashrc:

# Launch Fish
if [ -t 1 ]; then
  exec fish
fi

That's it!

Unix-style Windows Development Environment Adventures

Things I've learned thus far, while developing on Windows:

  • Cmder is an excellent terminal emulator, and the best one I've found for Windows. Highly recommended.
  • The Ubuntu Subsystem for Windows 10 is really quite stellar -- It's a full-blown Ubuntu operating system running along-side your Windows stuff.

Development:

  • I built Python 2.7.13 from source, after apt-get installing 'build-essential' and friends.
  • The Linux home directory resides at C:\Users\USERNAME\AppData\Local\Lxss\home\USERNAME.
  • The C:\ filesystem is available at /mnt/c.
  • It's much better to symlink from Linux into Windows filepaths, if you plan to edit your code in both environments. If you go the other way around, lots of strange permission errors occur.

Overall, things are going pretty well! I managed to develop and ship a release of Pipenv today on this machine, and while things weren't nearly as smooth as they are for me on a Mac, they were certianly workable!

So, I Bought a Surface Book

So, I decided to buy myself a Surface Book today. It's a surprisingly high quality device that easily competes with my MacBook Pro in terms of build and design.

I decided to buy it for a number of reasons:

  • I've been a little bit depressed lately, and new toys always help me get out of a funk.
  • There are a plethora of games available for Windows.
  • I enjoy the challenge of setting up a proper development environment on this platform.

So far, it's been a rather enjoyable experience. The new Unix Subsystem for Windows 10 is surprisingly enjoyable, and was able to produce a build of Python 2.7.13 without any problems. 

So far, I'd say there's only a 25% chance that I'll return the device. Fingers crossed!

Sublime Text 3 Heaven

I decided to revisit my editor configuration the other night, and experimented with every possible editor I could think of / imagine. I heavily configured vim (neovim), PyCharm, Eclipse, Emacs (Spacemacs), VSCode, Atom, Textual, and more. I knew I was going to stay put with my choice of Sublime Text 3 (which I have been using for 5+ years), but it's nice to have validation.

So, I decided to rebuild that configuration from scratch as well. I ended up with a very happy setup that I wanted to share with you. Here's a screencast of myself writing a little bit of code and pushing it to GitHub with this setup. 

 

Sublime UI Theme: Material

Sublime Text Extensions:

  • Anaconda — fantastic Python "IDE" support for Sublime Text. Just works, does everything you'd want it to do, including code completion and PEP8 checking. 
  • Color Highlighter — highlights colors present in code as the value provided (great for css).
  • Emmet  fantastic HTML shortcut utility. 
  • Package Control — (obviously)
  • SideBarEnhancements enhances the sidebar context menu options. Easily create new files and folders, etc. 
  • Themr — easily switch between themes.

 

Version Control:

  • GitGutter — display git diff information in the gutter of Sublime Text — extremely useful! Keeps track of added/removed lines. 
  • GitSavvy — very useful tool for committing/pushing with Git right from Sublime! 
  • GitStatusBar — shows git repo status in the bottom bar of Sublime Text. 

 

 

Syntax Packages:

  • Tomorrow Night Italics Color Scheme — italics for code comments, for Operator Mono
  • fish-shell — syntax highlighting for fish scripts. 
  • Jinja2 — syntax hilighting and snippets for jinjia2 templates.
  • RestructuredText Improved —syntax highlighting for RST files. 
  • requirementstxt — syntax highlighting for requirements.txt files. 
  • TOML — syntax highlighting for TOML. 
  • VimL — syntax highlighting for VimL. 

Fun Toys:

  • ASCII Decorator — right click on text, and turn it into ASCII art. 
  • Glue — terminal instance within Sublime. 
  • GitAutoCommit — a nifty little plugin that lets you set certian repos to automatically commit on save (useful for notes, etc). 
  • SublimeXiki — get the power of Xiki (shown in the screencast above, at the end) in Sublime!

User Key Bindings

[
    { "keys": ["super+2"], "command": "next_bookmark" },
    { "keys": ["super+1"], "command": "prev_bookmark" },
    { "keys": ["super+3"], "command": "toggle_bookmark" },
    { "keys": ["super+shift+3"], "command": "clear_bookmarks" },
    {"keys": ["super+g"], "command": "git_status"},
    {
        "keys": ["super+d"],
        "command": "set_layout",
        "args":
        {
            "cols": [0.0, 0.5, 1.0],
            "rows": [0.0, 1.0],
            "cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
        }
    },
]

User Settings

{
    "auto_complete": false,
    "close_windows_when_empty": true,
    "color_scheme": "Packages/User/SublimeLinter/Tomorrow-Night-Italics (SL).tmTheme",
    "draw_white_space": "all",
    "find_selected_text": true,
    "fold_buttons": false,
    "folder_exclude_patterns":
    [
        ".svn",
        ".git",
        ".hg",
        "CVS",
        "_build",
        "dist",
        "build",
        "site"
    ],
    "font_face": "Operator Mono SSm Light",
    "font_options":
    [
        "subpixel_antialias"
    ],
    "font_size": 12.0,
    "highlight_line": true,
    "hot_exit": false,
    "ignored_packages":
    [
        "Git",
        "GitSavvy",
        "RestructuredText",
        "SublimeLinter-flake8",
        "Vintage"
    ],
    "material_theme_accent_orange": true,
    "material_theme_accent_scrollbars": true,
    "material_theme_appbar_orange": true,
    "material_theme_arrow_folders": true,
    "material_theme_bullet_tree_indicator": true,
    "material_theme_compact_sidebar": true,
    "material_theme_contrast_mode": true,
    "material_theme_small_statusbar": true,
    "material_theme_small_tab": true,
    "material_theme_tree_headings": false,
    "remember_open_files": false,
    "rulers":
    [
        72,
        79,
        100
    ],
    "theme": "Material-Theme-Darker.sublime-theme",
    "translate_tabs_to_spaces": true,
    "trim_trailing_white_space_on_save": true
}

That's it! Enjoy :)

Announcing Pipenv!

I wrote a new tool this weekend, called pipenv. Check it out on GitHub!

Pipenv in action.

Pipenv in action.

Pipenv is an experimental project that aims to bring the best of all packaging worlds to the Python world. It harnesses Pipfile, pip, and virtualenv into one single toolchain. It features very pretty terminal colors.

It automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your Pipfile as you install/uninstall packages. The lock command generates a lockfile (Pipfile.lock).

☤ Features

  • Automatically finds your project home, recursively, by looking for a Pipfile.
  • Automatically generates a Pipfile, if one doesn't exist.
  • Automatically generates a Pipfile.lock, if one doesn't exist.
  • Automatically creates a virtualenv in a standard location (project/.venv).
  • Automatically adds packages to a Pipfile when they are installed.
  • Automatically removes packages from a Pipfile when they are un-installed.
  • Also automatically updates pip.

The main commands are installuninstall, and lock, which generates a Pipfile.lock. These are intended to replace $ pip install usage, as well as manual virtualenv management.

☤ Basic Concepts

  • A virtualenv will automatically be created, when one doesn't exist.
  • When no parameters are passed to install, all packages specified will be installed.
  • When no parameters are passed to uninstall, all packages will be uninstalled.
  • To initialize a Python 3 virtual environment, run $ pipenv --three first.
  • To initialize a Python 2 virtual environment, run $ pipenv --two first.
  • Otherwise, whatever $ which python will be the default.

☤ Other Commands

  • shell will spawn a shell with the virtualenv activated.
  • run will run a given command from the virtualenv, with any arguments forwarded (e.g. $ pipenv run python).
  • check asserts that PEP 508 requirements are being met by the current environment.

☤ Usage

$ pipenv
Usage: pipenv [OPTIONS] COMMAND [ARGS]...

Options:
  --where          Output project home information.
  --bare           Minimal output.
  --three / --two  Use Python 3/2 when creating virtualenv.
  --version        Show the version and exit.
  --help           Show this message and exit.

Commands:
  check      Checks PEP 508 markers provided in Pipfile.
  install    Installs a provided package and adds it to...
  lock       Generates Pipfile.lock.
  run        Spans a command installed into the...
  shell      Spans a shell within the virtualenv.
  uninstall  Un-installs a provided package and removes it...
  update     Updates pip to latest version, uninstalls all...


$ pipenv --where
Pipfile found at /Users/kennethreitz/repos/kr/pip2/test/Pipfile. Considering this to be the project home.


$ pipenv install
Creating a virtualenv for this project...
...
No package provided, installing all dependencies.
Virtualenv location: /Users/kennethreitz/repos/kr/pip2/test/.venv
Installing dependencies from Pipfile.lock...
...

To activate this project's virtualenv, run the following:
$ pipenv shell


$ pipenv install pytest --dev
Installing pytest...
...
Adding pytest to Pipfile's [dev-packages]...


$ pipenv lock
Assuring all dependencies from Pipfile are installed...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Note: your project now has only default [packages] installed.
To install [dev-packages], run: $ pipenv init --dev



$ pipenv install --dev
Pipfile found at /Users/kennethreitz/repos/kr/pip2/test/Pipfile. Considering this to be the project home.
Pipfile.lock out of date, updating...
Assuring all dependencies from Pipfile are installed...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Note: your project now has only default [packages] installed.
To install [dev-packages], run: $ pipenv install --dev
Installing dependencies from Pipfile.lock...
...


$ pipenv uninstall
No package provided, un-installing all dependencies.
Found 25 installed package(s), purging...
...
Environment now purged and fresh!


$ pipenv shell
Spawning virtualenv shell (/bin/zsh).
(test)$

 

☤ Installation

$ pip install pipenv

✨🍰✨