Morgan's World

May 12, 2010

#grid (hashgrid) WordPress Plug-in

After using the #grid feature on the Analog website, I decided to add it to my development toolbox. I’ve been working on WordPress for the past few months, so I thought I’d try to make a plug-in out of it. After poking around the Analog site a bit, this is what I came up with. Feel free to comment or tweak as needed.

I wanted this to be as simple as possible, so all it does is load up the CSS and JavaScript files. The hashgrid.js file does all the heavy lifting.

You can download the plug-in here.

January 7, 2010

Threads of Compassion

About two years ago, Jessica started crocheting with the help of some of the ladies from church, and she is really good. She also has great concern for others and is always looking for ways to help. Put those together and what do you get?

Threads of Compassion OKC.

About a week ago, Jessica followed a link on one of her crocheting sites that took her to Threads of Compassion – a Chicago-based program that knits and crochets scarves for survivors of sexual assault and abuse. Excited about another way to serve others, she decided to establish the Oklahoma City chapter of this group and contact the YWCA to see if they could use this service. They readily agreed.

Yesterday, we talked some more about it and how we could move forward. We talked about who else could help from the start with either donations or creations, how to package the scarves so that they’ll stay nice and how best to present them. We decided on a name for the chapter and that we should set up a site to share this work with others.

By we, I mean Jessica. She has such passion for this that I just listen and help where I can.

So, here it is: Threads of Compassion OKC. Our start at a blog to share this project with others. If you’re interested in crocheting, knitting, helping others, providing comfort, or just have yarn that you’re dying to do something with – here’s your chance. Get involved and help someone who’s hurting.

July 12, 2009

Go Light Your World

Filed under: church — morganestes @ 3:29 pm
Tags: , ,

The theme of Missions Sunday at Memorial Road Church of Christ this year is “From Our Town to the World”, which celebrates missions locally and globally.  The theme song is “Go Light Your World”, which is a great song to set our minds on.  I was able to shoot some video from our worship service this morning, along with some of the project we worked on – preparing care packages for our missionaries.

You can check out some of the video below, and view the others at www.qik.com/morganestes.

07/12/2009 Duration03:00 View Count4 views

more about “Qik | Morgan Estes | MRCC Missions Su…“, posted with vodpod

WordPress Tags: World,theme,Memorial,Road,Church,Christ,From,Town,song,packages,Missions

June 29, 2009

Display Featured Links Randomly Using PHP

Filed under: 1 — morganestes @ 8:31 am
Tags: , , , , ,

I had a request to add a "Link of the Day" feature to one of the pages on the Law-related Education pages of the OBA Web site using what we currently have in place.  I’m sure there are widgets out there already that will do this for me, and it may even be built into whatever CMS we deploy next, but I wanted to learn a bit so I decided to implement it on our current site.  I don’t know much about PHP, but I learned to code in VB.NET and C++, so I can learn enough as I go to make things work.

With the help of The Google, I was able to piece together a little bit of code that reads from a CSV file into an array, then randomly displays a link from within that array on each page load, so that a new link is loaded on each visit.

The original code has appeared in several forms across the Internet already, so if it’s yours, please let me know so I can credit you.  I’ve made some slight adjustments to fit my needs.


  1: <?php
  2: function makeClickableLinks($text) {
  3:
  4:   $text = eregi_replace('(((f|ht){1}(tp|tps)://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
  5:     '\\1', $text);
  6:   $text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
  7:     '\\1\\2', $text);
  8:   $text = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})',
  9:     '\\1', $text);
 10:
 11: return $text;
 12:
 13: } // end function
 14:
 15:
 16: function displayLink(){
 17:
 18: $fp = fopen("your-file.csv", "r");
 19: while (!feof ($fp)) {
 20: $contents[] = explode(",", fgets($fp, 512));
 21: }
 22: fclose ($fp);
 23:
 24: do {
 25: 	$x = rand(0, count($contents)-1);
 26: 		} while ($contents[$x] == '0');
 27:
 28: // displays link title above clickable URL
 29: echo $contents[$x][0] . "<br />\n" . makeClickableLinks($contents[$x][1]) . "<br />\n";
 30:
 31: // displays link title as clickable link
 32: echo '<a href="' . $contents[$x][1] . '" rel="nofollow">' . $contents[$x][0] . '</a>';
 33: 
 34: } // end function
 35:
 36: ?>
 37: <body>
 38: <?php displayLink(); ?>
 39: </body>

Click to view a working sample of this page here.

WordPress Tags: Display,Links,Link,Education,code,Google,Internet,text,Click,Development,adjustments,makeClickableLinks,eregi_replace,displayLink,clickableNote: Cross posted from Estes Technology Group.

Permalink

June 17, 2009

Don’t Forget to Clean Your Code!

Filed under: Web Development — morganestes @ 10:07 am
Tags: , , , , ,

I recently was asked to update a Web page with a rather long list of names, which were provided in a Word document.  I use a combination of Dreamweaver and Expression Web, because they both have good tools for stripping out problematic HTML from Word, but today they weren’t much help.

This particular document had a table (of sorts) built into it, which listed names and cities, but after a good ol’

copy and paste, I found that things didn’t quite line up.  Upon closer review, I found that the “table” was actually made up of tabs and spaces.  While this worked in Word, it made a horrible mess for the Web.  Just doing a copy and paste job created spaces (technically non-breaking spaces — “nbsp”) that seemed like empty space, but actually take up quite a lot.  In fact, these spaces made the page 322kb!  Most of the larger pages on the site were around 20-25kb, so I took another look at things.

In this case, I decided not to go with a table for the little bit of text that could fit in, instead going with the city name in parentheses after the person’s name.  After removing all the nbsp’s from the code, I was able to shrink the page to 32kb – a 90% reduction in page size!  That means the page will load in just over 1 second, instead of over 12 from before.

So, to recap:

  1. Copy and paste doesn’t work as expected with the web, so be prepared to clean up your code a bit.
  2. Check for spaces that don’t belong, particularly the “ ” – they take up more space than just hitting the spacebar does.
  3. Use a tool like Firebug for Firefox, or the built-in tools in several other browsers (IE8, Safari 4, Chrome) to test your page for load times and see how you can improve them.

Windows Live Tags: Code,Word,Dreamweaver,Expression,tools,HTML,spaces,text,reduction,size,Copy,tool,Firebug,Firefox,Safari,Chrome,nbsp

WordPress Tags: Code,Word,Dreamweaver,Expression,tools,HTML,spaces,text,reduction,size,Copy,tool,Firebug,Firefox,Safari,Chrome,nbsp

May 27, 2009

Deja Vu All Over Again

Filed under: church,LST,Navy,recovery — morganestes @ 7:45 pm
Tags: , , , , , , ,

We’ve been driving around parts of Panama City the past week and a half during our off time, mostly around Albrook and Balboa areas.  It’s been weird knowing that I’ve been here before, but not really the same areas.

Until this past Saturday.100_2216

See, this is the first country, really the first city, I’ve been to as a civilian that I once spent time in while I was in the Navy.  I knew some of the area was familiar, but in that general “yeah, this seems familiar” kind of way.  Driving through a part of Balboa, it hit me:  I’ve been THERE before.  I recognized the little shopping area where I bought a hummingbird carved from a nut, and where I bought a painting that still hangs on our wall at home.  I even drove by (a couple of times now) the McDonalds that we all ate at, and that I ordered an “hamburgesa sin carne” (hamburger without meat, for a vegetarian friend).  I’m going to see the Panama Canal this coming Saturday as a tourist.  The last time I saw it, I was in the middle of it on “el barco blanco” – the USNS Stalwart (T-AGOS 1).

I am a changed man since I was here last, so my feelings aren’t coming back like I want to re-live those days, but man, it’s a strange feeling some time.  I’m glad I can remember some of the past and see the difference in my life now, and sometimes I’m glad that I don’t have memories of other things.  But the truth is, I have more than enough, and don’t always want the ones I have.

The main point is, this to me is proof that you can begin again.  I’m in the same place physically, but a totally different place spiritually.  I can have good memories and not get caught up in bad ones.  I can be thankful that I’ve had the opportunity to travel all over the world, serving my country in one life, and serving God in another.

Wonder what’ll come up next?  I’m excited to find out myself.

February 11, 2009

Living with ADD…look, a butterfly!

Filed under: ADD/ADHD,church — morganestes @ 7:57 pm
Tags: , , , ,

Wednesday nights at church have been pretty interesting the past month or so.  I’ve been part of a class for parents and educators of children with ADD/ADHD.  I’m neither, but it seems like a perfect fit for me since I’ve been living with ADD for over 20 years now.  In fact, just getting to the class was the result of ADD.

Each quarter, MRCC has a varied selection of classes, many of which I am interested in attending.  This time, there were three that seemed like winners for me, but I settled on studying Leviticus.  The first Wednesday of the quarter, I started heading to class but before I did, decided to look at the class listings one last time.  A class on the book unChristian had been on my mind earlier, and my mind said “hey, let’s go to that one!”  Yes, my mind often talks to me.  Heading to class, I passed by the classroom where “Marching to the Beat of a Different Drum” was being watched and discussed.  My ADD mind led me right there.  Too many decision opportunities presented themselves and that’s what happens most time, I just randomly pick one.  Fortunately for me, those decisions seem to work most of the time; when they don’t, I can give it another try.

This ended up being great for me, and I think for others in the class.  I’m not necessarily whom the class was for, but I think I’m bringing to the table a look at what an adult who grew up with ADD looks like, struggles and victories alike.  So the whole point is this: ADD is something that’s challenging, but usually ends up being a blessing in various disguises.  How about you, have you had ADD moments like this that ended up being great?  Let me know in the comments below.

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.