Follow Me On Twitter

A long overdue update

06/10/2009

 Well, It has been a long time since I have written and I think that is because when I think of writing I think that I have to have some well polished literary masterpiece to be worthy to post here. Truth is I am not a writer so I will never have a literary masterpiece to publish here so I just need to get off my butt and write something.

In my personal time I have been studying justice. Its a big topic and I do not claim to know much at all about it. So let me just ask some questions that I will try to address in future posts (I will try my best to write on a regular basis).

  1. What is justice? This seems like you could just ask dictionary.com for the answer but it is a little more involved than just a definition.
  2. As Christians we are supposed to be just. How does this play out in our day to day lives?
  3. What do you do when injustice is going on and the law makes no provision for justice?
  4. Is vigilante (done violently and summarily, without recourse to lawful procedures) justice really justice?

Those are some big questions to ask. Ponder them. Leave comments. Check back to see what I have to say about them.

 

no comments

Simple CSV Dump Of Active Record Objects

04/17/2009

So today at work I had the need to dump a list of active record objects into a csv file. My first thought was that is simple enough. I'll just hack something together really quick and dirty like. Then I remembered Ruport. Ruport is a gem that aims at making reporting with Ruby as simple as possible and it integrates with active record to allow automagical creation of csv files. Win!

However getting this to work was not as straight forward as it should have been and there was no one place on Google that had all of the answers so here it is.

  1. gem install ruport
  2. gem install acts_as_reportable
  3. In config/environment.rb add the following to the bottom of the config block:
    require "ruport"
    require "ruport/acts_as_reportable"
  4. In your model that you want reporting add the following
    acts_as_reportable
  5. Now you can do things like Model.report_table.to_csv

Well that was all that I needed to be able to do. It looks like Ruport has a lot more functionality so check it out if you are doing any kind of reporting with Ruby/Ruby on Rails. 
 

 

no comments

Boxcar Release Coming Soon

03/26/2009

So I have a lot on my plate right now. I am getting ready to move to Fredericksburg, VA at the beginning of next week. In the midst of getting ready to move my Dad came and visited. And to top things off I am filled with programming unction and as all programmers know, when you have the urge to program, you program, otherwise you lose it. What is the by product of this?

Boxcar. What is Boxcar? I am glad you asked. Read the FAQ's below.

FAQ's

  1. What is Boxcar?
    Boxcar is the brand new blogging platform that I am creating.
  2. What? Why do we need another blogging platform?
    To be honest we don't. I am creating this for several reasons.
    1. I wanted to create something.
    2. Typo, the blogging platform I currently use was causing me trouble.
    3. I wanted to create something. Wait I said that. But I think that was the biggest contributing factor.
  3. What does Boxcar have as far as features go?
    Not much as of now. Its bare bones software. I have posts, comments, spam filtering, and theming working. I am working on some sort of dynamic sidebar system. That should be coming soon.
  4. Where is the code?
    On my computer. No, it's not out there yet. I don't think its polished enough for a 0.1 release. When I finish the sidebar system the I will clean everything up and release. It will be open source, I have no idea about the license.
  5. How soon will that be?
    Don't expect it for at least 3 weeks. Like I said, I am moving in 4 days. I get up to Fredericksburg and then I am attending the Awaken The Dawn conference for 5 days, and then I am going to Orlando for a weeklong vacation. I promise sometime soon after that I will get out a 0.1 release. At that point I will also switch my blog over to it.

Well, I think that is about it. If I don't blog much for the next few weeks its because I a moving. Watch my twitter.

1 comment

Simple MySQL Database Backup Script in Ruby

03/16/2009

 Ok, so part of the reason for me doing this blog is for me to start writing about programming and posting things people may find useful. So I decided I would kick things off with a quick little script I wrote today. It is not the best Ruby code I have ever written. I have a tendency to write procedural code when I am doing a little one off script like this. I would prefer to make it object oriented but I do not have time tonight to do that. Perhaps I will revisit and write a post on refacoring.

So what does this script do? Well thanks for asking. I needed to get mysql dumps from our databases and gzip them and throw them up onto Amazon S3. I need to do this once a day at midnight. The code is amazingly simple so I am just going to state what my usage needs were:

  1. I only need to do one backup a day.
  2. As of now it does a full mysql dump for simplicity's sake and because my dataset is not large enough to make a difference.
  3. I needed an offsite backup so I am throwing it up to S3.
  4. I made it into a shell script and threw it into /etc/cron.daily so it gets run once a day

With no further ado here is the code. 

Inspiration for this script was drawn from here.

no comments

I Have a Question Also

03/11/2009

 Once again my good friend Ian has inspired me. He has blogged, and now I will blog. This post is a response to a post on his site title "A Simple Question". In his post (please read it if you haven't yet, its not long at all) he poses one simple question, "If a woman is pregnant, then what is she pregnant with?"

Obviously to use pro-lifers the answer is a human child. However the other side would have us believe it is just a blob of tissue and what not. Now let me pose my question.

Have you ever heard of a medical provider who provides memorial services for the appendix that is taken from someone's body when it gets inflamed?

No? Well I haven't either, but that is exactly what the abortion industry does. For example, here is a website for a popular abortion provider. If you read that you will find that Dr. Tiller's clinic offers the "celebration of religious sacraments such baptism of the stillborn fetus and blessings for the aborted fetus."

From their perspective its a mass of tissue. Who blesses a mass of tissue that was was regarded as harmful enough to warrant physical removal from the body? Unless its not just a mass of tissue. Unless it was really a human being.

I think every one needs to walk outside, clear the cobwebs from their mind, take a deep breath of common sense, and then take a look at Ian's question once more...

"If a woman is pregnant, then what is she pregnant with?"

4 comments

One of "Those" Days

03/01/2009

Yes, today has been one of "those days". What is one of "those" days you may ask. Well let me enlighten you.

The free online dictionary(yes that is a real dictionary) defines "those" as the plural form of "that" and that it is used as a pronoun or an adjective. I am using it as a pronoun(please correct me if I am wrong) to refer back to a specific day, but as you noticed I am using it as a plural so its a specific type of day that has occurred on multiple occasions. 5 occasions to be exact.

It all started back about 2 years ago. I had moved down to Fort Mill from Washington DC, I am still not sure why, and I had some temporary living arrangements. Then I moved into a house with my friends Ian and Thomas. Occurrence number one.

After about 4-5 months things changed around. Ministries moved and Ian and I moved out of Thomas' house. To be fair Thomas moved out also. So what does that mean. Well we moved into a condo in a quaint town home area known as Manor Lakes with our good friends Levi and Heather Bethune and their then one child Isaiah. We affectionately call this place 706. Funny cause so does the United States Post Office. By moved I mean a one day affair. We packed, cleaned, transported, unpacked, arranged in one day. We could do this cause it was a mile or so away.

After living at 706 for about 6 months or so the person we were renting from wanted to sell so he kicked us out. Thankfully we were able to move into another condo just down the street know as 304. Notice a trend here? That was another one day move, only this time we carried everything the half block instead of driving everything the mile or so.

After a week at 304, we knew it was only temporary, we found a nice big house to move into. So Ian, Levi, Heather, and I all moved all of our junk another mile to 2014 Durand. We had a pretty good run at Durand. About a year. And then things started to change.

To make a long story short Ian and I moved out today. One day, two people, a lot of stuff. And like most times when we have to be outside packing things and what not it rained. However I got a free meal out of the deal so I'm not complaining. 

All that to say, I am in my bed in a new room after a long day of hard work and a longer night of hard fun. Stay tuned for my next moving story which should come in about six or seven weeks.

no comments

Heaven's Very Special Child

02/25/2009

Today is the 2 year anniversary of my brother Brenden 'Bubba' Kuhns' death. He passed away at the age of seven. I don't have much else to say. Below is a poem and some pictures. I wish you all could have known him. He was a special child and taught my family and I a lot about life. We love you Bubba.

A meeting was held quite far from Earth!
It's time again for another birth.
Said the Angels to the LORD above,
This Special Child will need much love.

His progress may be very slow,
Accomplishments he may not show.
And he'll require extra care
From the folks he meets down there.

He may not run or laugh or play,
His thoughts may seem quite far away,
In many ways he won't adapt,
And he'll be known as handicapped.

So let's be careful where he's sent,
We want his life to be content.
Please LORD, find the parents who
Will do a special job for you.

They will not realize right away
The leading role they're asked to play,
But with this child sent from above
Comes stronger faith and richer love.

And soon they'll know the privilege given
In caring for their gift from Heaven.
Their precious charge, so meek and mild,
Is HEAVEN'S VERY SPECIAL CHILD.

by Edna Massionilla

View more photos

no comments