Software Design
Software Development
Website Creation
Get in touch.
Dave Kruse
Principal
507.407.0317
dave@krusetech.com
Krusetech
Blog
ActiveStorage and uuid
ActiveStorage doesn’t play well with models using uuid. Here’s how to convert ActiveStorage to use uuid and fix errors like ‘activestorage ERROR: operator does not exist: bigint = uuid’
Haxe for JavaScript – Part 3: Classes, Modules, and Packages
In this the third part, we will look at classes and how haxe code is organized with modules and packages. Then we’ll peek under the hood and see how that translates to JavaScript.
JavaScript is a very flexible object oriented language, but that flexibility combined with the lack of the typical class construct you will find in ruby, java, c#, etc. results in a lack of standard convention. Conventions and standards are crucially important when code needs to be touched by more than one developer (or even the author who has since forgotten exactly what he was thinking at the time). While we have any number of libraries and frameworks to help implement convention, Haxe and its cousins (CoffeeScript, Typescript, Dart, etc) are popular because they offer more standardized implementation of classes, interfaces, inheritance, and modules.
Haxe for JavaScript – Part 2: Getting Started
The Haxe toolkit consists of the language, a standard library, and a compiler. Here’s an example that shows how to compile Haxe.
The Haxe compiler is a command line tool predictably named “haxe.” Instead of continually passing options to the compiler on the command line, the convention is to keep options in a .hxml file.
A typical setup might include a directory for haxe source code and directory for compiled javascript:
Haxe for Javascript – Part 1: Introduction
Haxe is a lesser known but quickly ascending language + toolkit. Haxe is used to write games, apps, and web apps on multiple platforms. Haxe itself is not natively supported, but rather it compiles to other languages including ActionScript, Java, C++, C#, Python, PHP, Node.js, and plain JavaScript. The ability to target multiple platforms has helped Haxe earn its primary identity as a game development tool. As such, you can easily find Haxe for game development resources. I am going to focus this blog series on Haxe and JavaScript for web applications.
Rails STI & Polymorphic Association for Easier File Management
Gems like paperclip have made file uploads easy. But something as simple as attaching images to models can get messy and repetitive in a large application. By using a combination of single table inheritance and polymorphic association, we can build dry code and make it easier to manage files.