Programming

Elixir Code Generator for Paw

Paw extension for Elixir code generation with the HTTPoison library.

1 minute read

I really love the Paw HTTP client. One of my favorite features is the ability to export requests in a variety of languages to share with other developers or drop into a quick project. Lately I’ve been spending a lot of time writing Elixir and mentoring other developers on the language and various frameworks. Elixir is a relatively new language so there wasn’t a code generator extension available for it.

3 minute read

AngularJS is a powerful library that allows you to create some amazing applications with relative ease. Unfortunately as the project grows, organization and structure start to become an issue. I’ve played around with a few bundlers and decided that Webpack fit my needs on my large AngularJS projects. Below I’ll show you how you can manage your JS code using Webpack while automatically including new files and having the ability to output both expanded and minified code for your development and production environments.

1 minute read

After trying out a bunch of online logging services I’ve really come to enjoy and rely on Logentries so I whipped up a library for Golang to support the service. It uses the token-based input and has the option to use SSL. Take a look below. Github Installation go get github.com/robottokauf3/go-logentries Basic Usage package main import ( "fmt" "logentries" ) func main() { // Using standard TCP connection logger, _ := logentries.

Recursively Include Routes in Node.js and Express

Sick of having either massive controller files or 50 million require statements in your Express applications? Here's a simple trick to load everything with 1 line.

2 minute read

Organizing Node.js applications can be a chore. They either have massive route / controller files which cover way too many concerns or they are broken into smaller files with 50 million require statements. Consider the following folder structure: Project_Folder ├── config │ ├── index.js ├── models │ ├── Model1.js │ ├── Model2.js │ └── Model3.js ├── public ├── routes │ ├── admin │ │ └── index.js │ ├── dash │ └── index.

2 minute read

If you’re not using Sass in your projects you should drop everything, read about it at http://sass-lang.com/ and start using it in your projects immediately. I’ve been using Sails.js a lot lately and enjoying it immensely. Unfortunately while it supports Sass’ cousin, Less, you have to make some configuration changes to get Sass to work. Luckily you can do it in 4 easy steps. 1) Install Grunt Sass plugin. npm install grunt-contrib-sass –save 2) Load the Sass plugin in Gruntfile.

1 minute read

I’ve been playing with Sails.js a lot lately and was thrilled that it supported my favorite database, Postgresql. Unfortunately the documentation on configuring the adapter left a lot to be desired. Installing Postgresql Adapter Installation is extremely easy thanks to NPM. Just enter the following command from the root directory of your project. npm install sails-postgresql –save Configuring the Adapter 1) Comment out or remove the code from the config/adapters.

1 minute read

By default Compass will place the .sass-cache folder in the project root directory. I prefer to keep all caches and temporary file builds for my projects in the .tmp folder. Luckily, Compass has the ability to set the cache folder location but it appears to be undocumented. Simply ass the following to the config.rb for the project: cache_path = ‘PREFERRED_PATH/.sass-cache’ # Eg. cache_path = ‘.tmp/.sass-cache’ Note: The cache_path is relative to the config.

Vagrant Error: undefined method forward_port

How to fix "undefined method 'forward_port'" error when using "config.vm.forward_port" in Vagrant 1.1 for Windows.

1 minute read

Ran into an interesting issue while using VirtualBox 4.2.10 with Vagrant 1.1.0 on a Windows 7 machine. All of the Vagrant documentation I found was telling me to use the following code in my VagrantFile to forward port 80 on the guest to port 8080 on the host machine. config.vm.forward_port 80, 8080 When trying to bring the box up the following error was being thrown: Vagrantfile:11:in ‘block in <top (required)>‘: undefined method ‘forward_port’ for #<VagrantPlugins::Kernel_V2::VMConfig:0x28b2040> (NoMethodError) I found tons of forum and blog posts which were stating that this was a problem with VirtualBox 4.

Guard LiveReload and CSS @import

Guard LiveReload is an amazing tool to speed up your web development but doesn't reload CSS files linked using @import. Luckily there is an easy fix!

1 minute read

Let me preface this post with the following statement: Don’t use @import for CSS files! It blocks parallel downloading so your browser has to wait for the CSS files to load before moving on. Unfortunately, sometimes you are stuck using @import and if you are also using Guard::LiveReload you will notice that your browser is not using the updated stylesheets when you save them. To fix that simply set the apply_css_live option as false in your GuardFile