Skip to main content

Posts

Setup Sinatra Application on Hostmonster.

Step 1 - Environment Setup Make sure that you have ruby installed on environment, and have SSH access. To your account. Step 2 - Create Ruby on Rails Environment Login to your Hostmonster C-Panel. Click Ruby on Rails icon. Fill out form with your information Step 3 - Setup Directory Link SSH into your account and goto where you would like the base of your app to be in. For example if you have website www.example.com and you want it hosted at www.example.com/myApp ln -s ~/rails_apps/myApp ~/public_html/myApp Step 4 - Clean up automatic Rails files. rm -Rf ~/rails_apps/myApp/* Once you have cleaned up the directory copy your sinatra files to ~/rails_apps/myApp If you have a Gemfile this would also be a good time to run a "bundle install" while you are in the directory. If you don't get your gems loaded you will experience problems. Step 5 - Setup your .htaccess file Open up your .htaccess file for the myApp directory and make it look like...

Set Git to stop tracking file

I have found the need to ignore a file with out using the .gitignore. In my case its because of a chrome driver that we using for Cucumber and Watir. The office has a standard setup with a certain repository, however on my Mac chrome likes to update. This causes an issue with versioning of the driver. So I wanted to put a new chromedriver in my repository folder but not ignore it from the repository. To do this little trick I can update the index and tell it to assume the file is unchanged. git update-index --assume-unchanged <file> If you have the need to reverse the tracking of the file. git update-index --no-assume-unchanged <file>

Git Autocomplete

Step 1 Run this command to get the .git-completion.bash file downloaded to your home directory. curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash Step 2 Add the following code to your .bash_profile which is located in the root of your home directory. if [ -f ~/.git-completion.bash ] ; then . ~/.git-completion.bash fi Now when you open up your shell you will be able to use the TAB key for your Git commands.

What Isaiah might say.

During my daily bible study I came upon Isaiah 1:1-20 and thought wow this sounds really familiar. I thought to myself... I wonder what it would sound like if Isaiah the prophet lived in the United States and saw all the things that are happening today. What would he say. This is my take. Maybe this could inspire you to take a crack at it on your own. Ladies and Gentlemen of the United States of America please take this to your heart. The sons and daughters of current and future generations are revolting against the Lord God Most High. We have lost the common knowledge of whom we serve, and placed and idol of money, and property in His glorious place. We are the richest sinful nation in the world, and are weighed down by the luxurious appeal of corruption and iniquity of others. We have abandoned the Lord, have no regret for the sin in our hearts and have completely turned away from him. When will this rebellion end? When will we see that the pain and suffering of bad health, de...

How to use Colors in the Command Line output with PHP

Here is a simple function you can copy into your php file and it will format whatever section of text you place in it with a certain background and foreground color. <?php function colorFormatText ( $string , $textColor , $bgColor ) { return chr ( 27 ) . "[" . $textColor . "m" . chr ( 27 ) . "[" . $bgColor . "m" . $string . chr ( 27 ) . "[0m" ; } ?> The Colors Here is a list of the colors available using this method. There are only 8 colors. Text Background Color 30 40 Black 31 41 Red 32 42 Green 33 43 Yellow 34 44 Dark Blue 35 45 Pink 36 46 Light Blue 37 47 White

Top 10 Mac Keyboard Shortcuts

Control + Option + Command + Eject shutdown time image This option is used to shutdown your Mac. This nice thing about doing this instead of shutdown menu is it bypasses the counter and immediately starts shutting down. Command + Option + Eject Puts the computer to sleep bypassing the countdown. Control + Shift + Eject Allows you to put the display to sleep Command + Space-bar shutdown time image Use this shortcut to open up the spotlight bar to search for an application or a file. Command + Shift 4 This will allow you to select an area of the screen to take a screen shot of. Generally your picture will be dropped to your desktop. Control + Command + D Dictionary shortcut. This is not my most used command but it can be useful in situations Command + TAB If you are familiar with Windows this is kind of like the Alt+Tab functionality to switch between open applications Option + Command + M Sometimes you just want to minimize everything on the screen to remove ...

JRuby Connection to AS400 DB

Hello friend, I suspect that by you visiting you are running in to the same issues I was having trying to get a database connection working using JDBC in JRuby. After that you may also be interested in the connecting to AS400 part. Please note that with a few tweaks of this example you can also connect to some other types of databases. I will note where as we go along. When coding the first thing we need to do is get our environment set up properly. At the time of this writing I am using JRuby-1.7.4. If you have JRuby ready to go the next thing that we will need is the JDBC Driver that does the leg work of connecting to the AS400 DB. I like to use the JTOpen JDBC driver to connect. You can get that at http://jt400.sourceforge.net/. Once you download the driver unzip it and look through the files for a jtopen.jar and copy it to a lib folder within your project directory. If you are wanting a different type of db you can search for a JDBC driver that would be appropriate. Lets make t...