May 2, 2013

Installing sonar source on Mac OSX

Update 30 June 2015 Part 2 is here with further instructions – Sonar Source is a an open source, browser based tool to manage code quality. You download and install it, setup some language specific plugins then let it loose on your codebase. It basically reports on data generated by doing a static analysis of your code on things like: Duplicate code Comment coverage Coding rules Unit tests Code complexity etc Installing it on a Mac is relatively painless, but there are quite a few steps to follow. ... Read more

January 21, 2013

Adding a global ignore file for git

Quick setup of ignore files for Git. You can of course set these up per repo, but that gets a little old. Instead you can setup a single ignore file and link to it so that every repo refers to it. For example, create a git ignore file in your home directory: ~/.gitignore_global Fill it with regular files that you want to ignore: #.gitignore # Railo files # ###################### WEB-INF/ # Sublime files # ###################### *. ... Read more

January 21, 2013

Showing hidden files in Finder on mac osx

Short and sweet, MAC OSX has this annoying trait where hidden files (dotfiles) are not visible by default in Finder. No probs, I’ll just go to the “View” menu and turn them on. Nope…nada, zip. Turns out you have to enter a command in the terminal, nice. Here it is for future reference: defaults write com.apple.finder AppleShowAllFiles TRUE Then kill Finder to have the changes take effect. killall Finder If you ever want to turn hidden files off? ... Read more

January 1, 2013

Downloading youtube videos

I wanted to grab some youtube videos for the kids and found this cool CLI utility called youtube-dl to handle it. I downloaded it from the website (you may need to chmod 755): wget https://github.com/downloads/rg3/youtube-dl/youtube-dl -O /usr/local/bin/youtube-dl However you can get it via brew if you want: brew install youtube-dl The basic process is the following: youtube-dl [video URL] By default that should download the highest quality format available (in case you didn’t know, youtube usually has multiple versions of a file for different qualities etc). ... Read more

November 21, 2012

JSON undefined issues on IE8 and IE9

I had some issues today while testing in IE, where “JSON” was undefined. This was happening in IE8 and IE9, which is strange because the JSON functions are in those IE versions. The problem was IE’s compatibility view, which triggers rendering in sort-of-IE7 mode. Classy. This was making JSON undefined ;( The usual fix for this is to add a meta tag to force IE to use “edge” (or a specific version if you like): ... Read more

October 4, 2012

Generating a powerset in ColdFusion

I recently needed to generate a powerset (a set of all subsets) of 3 HTML select boxes. The idea was that a user could choose 1-many options from each box, and they had to choose a value from all 3 boxes (none could be empty). Select #1 had 4 values Select #2 had 7 values Select #3 had 13 values Now, I needed to generate every possible permutation for these 3 select boxes based on the rules I defined above. ... Read more

September 30, 2012

Modifying FW/1 variables.framework properties

FW/1 gives you a nice, clean way to manage framework configuration properties. They’re all wrapped up inside Application.cfc in a structure called variables.framework, you can read more about them here under Configuring FW/1 Applications. Our applications often have a need to use different values for these properties, depending on which environment the application is running in (development, testing, staging, production etc). An example of this might be reloadApplicationOnEveryRequest, which we want as true in development, but false elsewhere else. ... Read more

September 27, 2012

Preventing FW/1 from reinitialising an app via the URL

One of the things that FW/1 allows you to do is configure a reload “key” and “password” which you can use to reinit your application via URL. So inside your Application.cfc you might have: variables.framework = { reload = 'reinit', password = "mysecretkey" … } So you can reinit your application (flush the application scope by re-running onApplicationStart()) by calling something like: http://www.example.com/?reinit=mysecretkey The “reload” and “password” properties can be changed to whatever you want for securities sake. ... Read more

September 26, 2012

Adding a mail server to a Railo instance

We turn off all GUI based administration consoles in our production environments, this includes Railo’s admin area. If you need to configure your Railo instance to include an SMTP server, you can add a line in WEB-INF/railo/railo-web.xml.cfm Open up that file (probably as sudo), look for the tag (which is empty by default) and insert the following: <server port="25" smtp="127.0.0.1" /> The “smtp” attribute should be the IP address of your SMTP server. ... Read more

September 24, 2012

Installing new fonts on Ubuntu server

I had some new fonts to install on our test server that runs Ubuntu server. Pretty simple really, just noting it down here for next time: Upload/ssh the font(s) to your home folder on the server Copy font to the system fonts folder, this way it can be used by all users on the system sudo cp -R ~/trade-gothic /usr/share/fonts/truetype/ Check permissions sudo chmod 755 /usr/share/fonts/truetype/trade-gothic/ Install the fonts so applications can use them sudo fc-cache -f -v

© Michael Sharman 2017