M-x Kelsin

programming

Tag: programming

Learning C++

Recently I’ve started brushing up on C++. I haven’t programmed in it seriously since college. After enlisting the helpt of local C++ experts I found the following books to use.

Home Directory Cleanup

I started looking into organizing my .zshrc which ended up taking me down a rabbit hole of crazy projects and dotfile repos. The result is the fact that I definitely want to redo my config repo. Here are my goals:

ZSH Prompt

Today I got my main zsh setup going. I made a new .zshrc based on many of the modules in Prezto.

ZSH

I’m going to try out ZSH again. I do feel like my bash config is getting a big slow and I want to see if zsh can improve that. I’m also really interested in learning how to use the directory expansion feature as well.

The Docker Train

I’m fully on board the docker train. I spent most of today moving one of my work apps into a docker development environment. The docker compose file consist of 4 containers. One for nginx (our proxy). One for our app. One container for redis and one container for redis-commander which is a redis debuging/inspection tool.

PaaS

At work we’re look into different paas solutions including AWS elastic beanstalk and OpenShift. If anyone I know has experience with either (or others) please reach out and let me know!

chruby

Switching from rbenv (and ruby-build) to chruby (and ruby-install). There isn’t a huge reason for the change other than I like their simplicity and want to try out something new!

Javascript Documentation

Recently I started a (low-key) open source project to take javascript projects and build documentation homepages out of them.

Ideas for side projects

I wanted to jot down my ideas for projects that I could work on.

Stunnel

I’ve had to test a lot of OAuth applications recently and would often need proper SSL running on localhost for them. When working on tiny little one page Sinatra or Express apps I didn’t want to learn how to setup each framework to use SSL properly so instead I just use stunnel to do it.

Projectile and Global in Emacs

Today I started using my Mac at work for java programming. When moving from windows to mac I also wanted to ditch IntelliJ and start using Emacs for java programming. This will definitely require a bunch of custom Emacs helpers in order to help navigate large projects.

WWDC 2014 Keynote

I was able to catch most of the WWDC keynote today. We watched it in our bullpen on our projector. I first tried to get work done and eventually gave up and just watched. Lots of cool stuff on the way.

Current Cygwin Thoughts

After trying out Cygwin for a while at work I have decided that I will keep using it on any Windows machines that I need to program on. That being said I found Emacs’s performance is very lacking so I’m not 100% sure on which method I’ll use to run Emacs in Windows.

Install Cask and Pallet to manage Emacs Packages

The package management that is built into emacs has gotten a lot better over the past few years (While I’ve been away) and the Melpa repository of packages is outstanding. Tonight I decided to take the next step and use some packages that help organize and keep my packages up to date: Cask and Pallet. You can see a commit of my changes on github.

Install Tmux in Cygwin

Originally I had found this page describing how to install Tmux in cygwin and I was able to accomplish this goal with relative ease. Once I realized that the instructions were dead simple, and that ncurses and libevent appears to already be included in cygwin I wanted to give it another go where I only installed tmux itself from source.

Setting up Cygwin

This weekend I tried to change over my computer from using msys (git and bash) as my main environment to trying out cygwin. So far so good. I’m also planning on setting up emacs as my main editor. I have not yet decided whether I’m going to use a native build of emacs, a cygwin build that uses the w32 native widgets, or a full cygwin/X environment.

Attempting Cygwin

After much though I’m going to try out Cygwin again. Tomorrow my system at work gets upgraded which means I have a brand new system to setup. I will try cygwin first prior to msys and see how far I get.

Switching to Vundle

After only a couple of days I did start finding git submodules annoying (again… who knew?). In order to get them out of my configs I’ve moved over from pathogen to Vundle. Pathogen lets all of your plugins behave like Mac Apps and line in their own little folders, instead of coexisting with other vim files in a single vim runtime folder (normally ~/.vim). Vundle takes this same approach but manages the git cloneing and updating of these plugins. So instead of autoloading whatever is in a folder, you define what plugins you want and are then able to install/update them from inside git.

Vim Autoloading

While writing my imports plugin I learned about vim’s autoloading feature. This started as me being confused (while looking at other plugins) about why some things were in the autoload folder and some were in the plugins folder. To me both folders appeared to be autoloaded at startup… but this isn’t the case!

Imports.vim

This project is NOT ready for full publication yet… it’s also not totally tested by me yet, but I want to write about how it works and how I learned enough vimscript to make it work.

Getting the full maven project classpath

I’m working on some vim plugins that will help with java coding and in the process of doing so I realized that most of my issues would be solved if I had a text file that lists all of the classes available in my project’s class path. I want to include:

Simple bash script to help install my windows environment

Today I made a quick bash script to automate a lot of what I talked about yesterday. You can always find the most recent version of this file in my configs repo but the first draft is also saved to a gist for this blog post.

QuickMug

I created a tiny gem to help me out with this blog tonight. It’s call QuickMug and it’s meant to help me out with uploading images to SmugMug.

Ruby Language Presentation

Today I’m giving a tiny informal talk to co-workers about ruby. You can find the source for my slides on github.

Tiny bits that I took away from Mongo Boston

So I attended Mongo Boston on Oct 3rd. It was a pretty great time. My favorite talk was Cowboy-coding by Aaron White. While not an indepth talk about Mongo it had a great feel to it, and made you really excited to make applications… which is why I like web development.

Using CanCan in an engine and your app

My current project involved an auth gem (internal) that provides user management into every app that it’s included into. I want this engine to be able to define some cancan rules since it determines the current_user and should allow some users to edit more than others when it comes to users, their roles, and the services they can access.

Trying out POW

So this morning I realized how annoying it is that I need to run 3 different rails apps for work (probably will be more in the future) and have about 3 freelance projects going at any given time. I hate having to start each rails server constantly. I’ve actually written a bunch of bash code in order to make this process easier. Sick of it.

Loading rake tasks from a gem in Rails 3

http://blog.nathanhumbert.com/2010/02/rails-3-loading-rake-tasks-from-gem.html

I think I want to create a gem that helps with minifying js and css. This link will prove useful!

Rails App Templates

I finally got around to creating a ruby app template. Of course my recent ruby work is not centered around creating new apps but I’m still glad I did it. Will save my some time!

You can read more about app templates or what a great screencast about them at other places. I don’t want to just repeat what others have already said but basically I created one so far and put it up on my github account.

The one question I have is about running this on a server without the haml gem already installed. I don’t really want it to try and install the gem in my home directory so we’ll see how that works out next time I have to do it. For now on my current linode it sets up a new rails project pretty nicely for my needs.

The one other interesting aspect of my template is my config system that I just wrote. It’s only two lines and it’s heavily stealing from other blogs. I never really had a good app config system and I don’t really want to use a plugin so I quickly wrote my own. It basically supports one config file (config/config.yml) and lets you setup default settings and then override / add to the defaults with per environment settings as well. For my wow raiding site this is working pretty well.

Here is the initializer file (config/initializers/config.rb):


CONFIG = YAML.load_file("#{RAILS_ROOT}/config/config.yml") || {}

CONFIG = (CONFIG['default'] || {}).symbolize_keys.merge((CONFIG[RAILS_ENV] || {}).symbolize_keys)

And my config.yml file from my raid site. This site uses a development environment (all defaults) and then two different production environments since I run the site for two different guilds. You can see how the “dota” environment inherits the auth setting while the “cod” environment adds a forum setting that I use when using phpbb authentication.


default:

  guild: Your Guild

  auth: login



cod:

  guild: Cake or Death

  forum: http://forum.cakeordeath-guild.com

  auth: phpbb



dota:

  guild: Daughters of the Alliance

Pretty simple and now I don’t even have to do anything to new rails projects to use it!