frontcoded.com
A dumping ground for web development stuff
OSX: Start Sublime Text 2 from the commandline
I often used vi to edit my local text files from the commandline. But actually vi is not my favourite choice for editing text. Here´s a tip, how to add Sublime Text 2 to the commandline. First, create a symlink from your /usr/local/bin directory, to the sublime binary: ln -s...
Change terminal colors in OSX with apple script
Sometimes it is useful to have your terminal tabs in different colors. This helps a lot for example, when you are working on multiple ssh remote connections. In order to avoid confusion, it´s a good idea to give different servers a different background color - like green for "staging" and...
Generate random passwords with javascript
Nothing special - just a simple function that generates a random password in JavaScript. I wrote this function, because I often used other password generators but pressed the 'generate' button as long as I had at least one digit and one special character in the generated result. That annoyed me...
Javascript: Resize a rectangle to fit into the bounds of another rectangle with proper ratio
Sometimes you have an image or something else that has to be resized to fit into the bounds of another object. Following function returns an object that contains the new width and height: /** * Fits a rectangle into anothers rectangles bounds * @param rect * @param bounds * @returns...
Run ruby on rails together with XAMPPs mysql socket on mac
If you want to run rails on your local machine and you already have XAMPP installed, then you propably want to use your mysql installation that comes with XAMPP. Here´s a short description, how to do that. First you need to tell the mysql gem the path to your files...