buntin.org

Moved to Wordpress

I got so sick and tired of dealing with comment spam I have moved my blog to Wordpress.  I plan on migrating all of the content (that was actually looked at) in the next day or two.  Stay tuned…

Remote Pair Programming

I know I haven’t always been the biggest fan of pair programming but I don’t think [in my past life](http://www.cabedge.com) it wasn’t a feasible solution.  At [work](http://www.notifymd.com) the other day we came up with a solution for pair programming while we are working from home.  We knocked it out and man it is pretty sweet.
Here are the things you are going to need
1) Server/Computer (with ssh access) that is accessible by both parties.
2) The computer must have screen.
You will need to run:
:::bash
$ sudo chmod u+s /usr/bin/screen
so that screen will allow for multiple users accessing the same executable.
Here is the [gist](http://gist.github.com/71662) of .screenrc located in your home directory.
Once you have all of this setup you are ready to go.
1) User 1 should log into the computer and if a screen session isn’t already started run:
:::bash
$ screen
If a screen session is already started then run:
:::bash
$ screen -r
2) User 1 should allow User 2 to access their screen session.  This is done by pressing Ctrl-A : then:
:::bash
acladd *user2-ssh-username*
3) User 2 should ssh into the computer and run:
:::bash
screen -x *user1-username*/
That should be it, both users should be able to see each others work.  This functionality only works well with command line editors but Vim and Emacs are great and powerful tools that should be a part of every programmers arsenal.
**Note:**  This assumes that all network settings are correct for each individual to access the box accordingly.

I know I haven’t always been the biggest fan of pair programming but I don’t think [in my past life](http://www.cabedge.com) it wasn’t a feasible solution. At work the other day we came up with a solution for pair programming while we are working from home.  We knocked it out and man it is pretty sweet.

Here are the things you are going to need

  • Server/Computer (with ssh access) that is accessible by both parties.
  • The computer must have screen.

You will need to run:

$ sudo chmod u+s /usr/bin/screen

so that screen will allow for multiple users accessing the same executable.

Here is the gist of .screenrc located in your home directory.

Once you have all of this setup you are ready to go.

  • User 1 should log into the computer and if a screen session isn’t already started run:
$ screen

If a screen session is already started then run:

$ screen -r
  • User 1 should allow User 2 to access their screen session.  This is done by pressing Ctrl-A : then:
acladd *user2-ssh-username*
  • User 2 should ssh into the computer and run:
screen -x *user1-username*/

That should be it, both users should be able to see each others work.  This functionality only works well with command line editors but Vim and Emacs are great and powerful tools that should be a part of every programmers arsenal.

**Note:**  This assumes that all network settings are correct for each individual to access the box accordingly.

Authorize.net Clojure library

Here is my first stab at building a quick clojure library http://sethtrain.github.com/clojure-authorize/

Clojure

Website: http://www.clojure.org

A buddy of mine told me about a new Lisp dialect called Clojure. I have never used Lisp before (other than setting up my Emacs environment) but this looks cool, if you can get over looking at all the parentheses. The language is built on top of the JVM so you have access to any Java packages from Clojure.

I think this is really huge especially from the standpoint of “enterprise” development. I develop every day in Django and Django is awesome. One problem that I have experienced while working with a web development framework that isn’t built in .NET or Java is that you basically give up working with “enterprise” companies because they tend to not trust anything other than those two languages, which is a problem in and of itself. Since clojure runs on JVM anything written in clojure will run on any machine running the JVM, kinda side stepping the idea that developing for “enterprise” has to be .NET or Java.

So I am going to look at Clojure and see what it has to offer. I like learning new things especially when they make me more of a geek.

jQuery Polling plugin

I wanted to create a chatting application and decided to create a jQuery polling plugin specifically for that purpose. I don’t know for sure if this is useful to anyone else but it works for me.

(function($) {
    $.fn.poll = function(options){
       var $this = $(this);
       // extend our default options with those provided
       var opts = $.extend({}, $.fn.poll.defaults, options);
       setInterval(update, opts.interval);

       // method used to update element html
       function update(){
           $.ajax({
               type: opts.type,
               url: opts.url,
               success: opts.success
           });
       };
    };

    // default options
    $.fn.poll.defaults = {
       type: "POST",
       url: ".",
       success: '',
       interval: 2000
    };
})(jQuery);

*Usage*

$("#chat").poll({
    url: "/chat/ajax/1/messages/",
    interval: 3000,
    type: "GET",
    success: function(data){
        $("#chat").append(data);
    }
});