Tags

Posts Tagged in ”php”

Export your Drupal content to Jekyll using PHP

Just this past week I migrated this blog over to Jekyll from Drupal. I had been using Drupal for the last couple years and I was getting frustrated with how many steps it took to post articles. So I decided to make the switch. Looking that the sparse Jekyll documentation...
Read more

Colorize - a PHP class to swap color in images

Colorize is a simple PHP class that allows you to supply template / source images and easily replace color(s) in them and save them as copies. It could be useful if you are building a theme generator for a site or framework. Or if you have to replace the same...
Read more

Get the fulll URL of the current page

Here is a simple function that will get the url of the current page. /** * getFullCurrentURL() * @author Jesse Baird <jebaird@gmail.com> * @since 09/18/2009 * @uses gets the full url of the current page * @return string | IE http://www.jebaird.com?var=val&test=yes */ function getFullCurrentURL() { $url = 'http://'; //are we...
Read more

Caching Dynamic PHP Pages Easliy

Over the past month or so I have been toying with the idea of developing a way to cache dynamic PHP pages with out a lot of overhead.  I stumbled across this blog entry: http://papermashup.com/caching-dynamic-php-pages-easily  the idea was so simple it was almost too easy.  So I took it upon...
Read more

PHP MySQL Row Lock function

I just started on a project that I knew was going to need some sort of data lock that would prevent 2 users from editing the same data at the same time.  At first I thought that i would have to write a function that behaved like the C function...
Read more

php forcing SSL Connection

I was updating some code on dirtondirt.com.  We had changed the way sessions/logins where used on the site. Everything worked great in Firefox.  But we were getting complaints that it was randomly dropping logged in users using IE .  I was was not able to recreate the issue so it...
Read more

PHP Countires, States, Provinces and Territories Array

A couple of projects ago I needed the ability to have international users. I looked for some php functions that would make the task of registering users a little easier. I found some html lists and turned them into php functions that return arrays ** * getAustralianTerritories() * @since 1.2...
Read more

Php MySQL pagination with one database query

Pagination is one of the simple features of a site if used right can be a great feature.  For something very simple it seems to be a resource hog.  For a while I have been looking for a way to paganate with out issuing two database queries.  After some quick...
Read more

Posts Tagged in ”mysql”

PHP MySQL Row Lock function

I just started on a project that I knew was going to need some sort of data lock that would prevent 2 users from editing the same data at the same time.  At first I thought that i would have to write a function that behaved like the C function...
Read more

Php MySQL pagination with one database query

Pagination is one of the simple features of a site if used right can be a great feature.  For something very simple it seems to be a resource hog.  For a while I have been looking for a way to paganate with out issuing two database queries.  After some quick...
Read more

Posts Tagged in ”geolocation”

Posts Tagged in ”session”

Posts Tagged in ”Internet Explorer”

Posts Tagged in ”SSL”

php forcing SSL Connection

I was updating some code on dirtondirt.com.  We had changed the way sessions/logins where used on the site. Everything worked great in Firefox.  But we were getting complaints that it was randomly dropping logged in users using IE .  I was was not able to recreate the issue so it...
Read more

Posts Tagged in ”JavaScript”

timeout, a setTimeout wrapper for jQuery

Timeout is a simple jQuery plugin that allows you to delay the execution of code for a certain number of milliseconds. It works like the jQuery delay plugin http://www.evanbot.com/article/jquery-delay-plugin/4 which i didn't know existed at the time I wrote this plugin. plugin code /* timeout a setTimeout wrapper for jQuery...
Read more

JW player with SWFObject

Recently i was working on a project that required a flash media player.  I was trying to integrate JW FLV Media Player using SWFObject.  After losing a few hours of my life trying to pass a variable in a query string to a php script that generated a XML play...
Read more

Posts Tagged in ”performance”

Using Regular Expressions to Test Variable values

When creating a function in javascript its a good idea to check object the object type(s) of the arguments pasted to function.  Lots of times you end up with code looking like this to do this if(typeof(foo)=='undefined'|| foo==''){ ////do something } Earlier this week I ran across Paul Irish's jQuery Anti-Patterns...
Read more

Posts Tagged in ”jQuery”

timeout, a setTimeout wrapper for jQuery

Timeout is a simple jQuery plugin that allows you to delay the execution of code for a certain number of milliseconds. It works like the jQuery delay plugin http://www.evanbot.com/article/jquery-delay-plugin/4 which i didn't know existed at the time I wrote this plugin. plugin code /* timeout a setTimeout wrapper for jQuery...
Read more

Posts Tagged in ”Opinion”

Looking Back at My First Year as a Tech Lead

Over the holidays I started reading Talking with Tech Leads by Patrick Kua. Having just completed reading the novices section of the book and found it spoke to the many challenges that I faced during my first year as a Tech Lead, I though would share some of my own...
Read more

Before you move to Voice over IP have these bases covered

EdgeCore just moved office buildings and I was put in charge of setting up the network and phone systems. A couple of the guys recommended VoIP. It sounded like a good idea at the time. So I went along with the recommendation. I got a quote from 8x8.com and everything...
Read more

Posts Tagged in ”firefox”

Clearing a Firefox Session Manually

Every once in a while I run in to a small issue with Firefox not loading correctly when i save my session.  It seems to happen when I have multiple tabs open that have lots of JavaScript running in them.  In my case I couldn't access the GUI like in...
Read more

Posts Tagged in ”javascript”

Creating a custom scrollbar with scrolljs

Over the past couple of years I have run into several cases were I needed to interact with the dom properties related to scrolling an element. I found my self wishing / searching for library to handle the nuances of the api. So I wrote scrolljs. Scrolljs aims to make...
Read more

JavaScript Equivalents in CSS

With the wide support of css3 we can use css to do some of the things that could only be done in javascript in the past. Here are a couple of my favorites. Togging an element visibility with :hover Using the pseudo selector :hover, we can show and hide elements...
Read more

Javascript templating engines - quick overview

I recently gave a talk on javascript templating engines and was able to for the first time record it with google over air hangouts. This was one of the first presentations that I have given over javascript. I find templating a very diverse topic. It seems that there is't a...
Read more

Data Registry, Simple Data Caching for JavaScript

In most of the web apps I have written I have had to track / cache simple. It might a jQuery selector or a small group of objects in an array.  In some form or another I end up doing something like this to get / set data. appname.data.user[appname.data.state.activeUser].username; Enter...
Read more

Using Regular Expressions to Test Variable values

When creating a function in javascript its a good idea to check object the object type(s) of the arguments pasted to function.  Lots of times you end up with code looking like this to do this if(typeof(foo)=='undefined'|| foo==''){ ////do something } Earlier this week I ran across Paul Irish's jQuery Anti-Patterns...
Read more

Posts Tagged in ”jQuery UI”

Overflow menu a jQuery UI Widget

I decided to turn an earlier post idea (See http://jebaird.com/blog/using-jquery-create-overflow-menu-seen-google-wave ) into a jQuery UI widget. Its based on the google wave menu. view the demo GitHub repo What It Does  It detects which menu items are hidden in the parent element overflow. Takes the hidden items clones them and...
Read more

Setting new default options for jQuery UI widgets

I was messing around with the dialog widget trying to figure out away to have it remove its self after the user closed the dialog.  I tried listening to the dialogclose event but that didn't work.  After playing around with it turns out you can override the default options like...
Read more

Posts Tagged in ”projects”

Making default values for date inputs easy

demo github Setting the default value for an input from markup has been done by ` value=”hello world”. I thought this was true for all input types including, date. It turns out that is not the case. Unless the value attribute is in this format YYYY-MM-DD` the input will not...
Read more

Wallpaper Collection

Over the past year I have spent a bit of time every week finding interesting backgrounds for my desktop. I was increasingly getting annoyed with the amount of time I was spending on this never ending project. So I decided to roll my own Windows 7 theme with the backgrounds...
Read more

Chromecast Style Windows 7 Sidebar Gadgets

I’ve had a Google Chromecast for a couple of months, one of the things that I really like about it is how the time was displayed in the bottom left corner. So I decided to create a set of windows sidebar gadgets that look like they would fit on the...
Read more

jQuery cloneVal, automatically copy :input values

It’s been awhile since I released a good old fashion jQuery plugin. cloneVal targets :inputs on a form and lets you copy/clone the value to one or a set of target :inputs. view the code in action GitHub A practical use case for this plugin would be an e-commerce form...
Read more

Creating a custom scrollbar with scrolljs

Over the past couple of years I have run into several cases were I needed to interact with the dom properties related to scrolling an element. I found my self wishing / searching for library to handle the nuances of the api. So I wrote scrolljs. Scrolljs aims to make...
Read more

Overflow menu a jQuery UI Widget

I decided to turn an earlier post idea (See http://jebaird.com/blog/using-jquery-create-overflow-menu-seen-google-wave ) into a jQuery UI widget. Its based on the google wave menu. view the demo GitHub repo What It Does  It detects which menu items are hidden in the parent element overflow. Takes the hidden items clones them and...
Read more

HTML5 Canvas Image Randomizer

I wanted to decrease the sizes of my pages on my blog with out changing my design. I had been using css sprites and gziped css + with base64 encoded images but due to my design my page size was 1500k on an empty cache.  My blog was like this...
Read more

Posts Tagged in ”ckeditor”

Changing the background color of a ckeditor instance

ckeditor is great once you get past the steep learning curve. Lately I have been looking for a way to change the background color of the editor / where you enter in the content on the fly. If you google "ckeditor change background color" you will find that most results...
Read more

Posts Tagged in ”hardware”

Installing Android x86 on a Gateway LT21 Netbook

A few years back I jumped on the netbook craze and bought the Gateway LT21. I was pretty cool to have a small computer that actually had 8 hours of battery life. But in the last year or so, It became un-usably slow running windows / linux. Leaving it to...
Read more

Fixing exhaust / blower fan (ADDA Model AD2512LB)

I have a Li Lian v2100 plus case that i bought 5 years ago. Everything about the case screams quality except for the exhaust/blower fan( ADDA Model AD2512LB). The first blower that came with the case died about a year after I got the case. After looking for days I...
Read more

Posts Tagged in ”jquery”

jQuery cloneVal, automatically copy :input values

It’s been awhile since I released a good old fashion jQuery plugin. cloneVal targets :inputs on a form and lets you copy/clone the value to one or a set of target :inputs. view the code in action GitHub A practical use case for this plugin would be an e-commerce form...
Read more

Trigger all events on an element using jQuery

triggerAll is a simple plugin that will allow you to trigger all the events attached to an element and or collection (function($){ $.fn.triggerAll = function(){ return this.each(function(){ var $this = $(this); $.each($this.data('events'),function( k, v){ $this.trigger( k ); }) }); } })(jQuery);  
Read more

Posts Tagged in ”events”

Trigger all events on an element using jQuery

triggerAll is a simple plugin that will allow you to trigger all the events attached to an element and or collection (function($){ $.fn.triggerAll = function(){ return this.each(function(){ var $this = $(this); $.each($this.data('events'),function( k, v){ $this.trigger( k ); }) }); } })(jQuery);  
Read more

Posts Tagged in ”html5”

Web Components - IowaJS, Oct 2013

Looking back, jQuery UI was my first experience with “web components”. When I first discovered them I as amazed as to how easy it was to setup any widget. Just include jQuery and jQuery UI and just call the widget code. In the exsmaple below, .button() Setting up of an...
Read more

Fun with HTML5 templates and shadowDom API

I recently started playing around with the new <template></template> tag introduced in html5. On the surface it looks pretty plain, it appears to another template engine. But when combined with the shadowDom API it can be pretty powerful. Take this code example. <div id="target"> <span class="label">Enter your name</span> <span class="name">name</span>...
Read more

HTML5 Canvas Image Randomizer

I wanted to decrease the sizes of my pages on my blog with out changing my design. I had been using css sprites and gziped css + with base64 encoded images but due to my design my page size was 1500k on an empty cache.  My blog was like this...
Read more

Posts Tagged in ”canvas”

HTML5 Canvas Image Randomizer

I wanted to decrease the sizes of my pages on my blog with out changing my design. I had been using css sprites and gziped css + with base64 encoded images but due to my design my page size was 1500k on an empty cache.  My blog was like this...
Read more

Posts Tagged in ”forms”

Posts Tagged in ”css”

Minifying CSS in Jekyll with cssify and strip_newlines

I recently discovered that Jekyll now supports SCSS and SASS files. Which is pretty cool because before you couldn’t use easily use them with github pages. Kevin Sweet the developer who wrote the filters for jekyll 2.3.0 breaks them down in this post In his example you can inline scss...
Read more

JavaScript Equivalents in CSS

With the wide support of css3 we can use css to do some of the things that could only be done in javascript in the past. Here are a couple of my favorites. Togging an element visibility with :hover Using the pseudo selector :hover, we can show and hide elements...
Read more

Avoid Using Shorthand When Building a CSS Framework

Building a css framework is a bit different than vanilla css. Consider this css block. .box { padding: 5px 10px 5px 15px; } It’s pretty straight forward, there is nothing new here. But if you wanted to override the padding value using shorthand you would have to do something like...
Read more

CSS3 Pseudo Selectors are Broken When Using :not():nth-of-type()

CSS3 pseudo selectors have a lot of power. Lately I have been playing around with :not(), :nth-child() and :nth-of-type(). One thing that I discovered while working on table row striping is that :nth-of-type() and :nth-child() ignore / override :not(). I was trying to stripe all of the odd rows in...
Read more

CSS double border using box-shadow

Getting a double border with a different color doesn't leave you with may options.You can use border-style: double or outline: 1px solid blue. But I wanted the double border only on one side, so I decided to play around with the box-shadow rule. Check out the jsfiddle below. I'm using...
Read more

Posts Tagged in ”box shadow”

CSS double border using box-shadow

Getting a double border with a different color doesn't leave you with may options.You can use border-style: double or outline: 1px solid blue. But I wanted the double border only on one side, so I decided to play around with the box-shadow rule. Check out the jsfiddle below. I'm using...
Read more

Posts Tagged in ”cisco”

Simple Cisco 851w config

I have had my Cisco 851w for a number of years most of which I used it as an access point. A couple months back I switched ISP's and was able to use it as my router. It had been a very long time since I had configured a Cisco...
Read more

Posts Tagged in ”aptana studio”

Useful Plugins for Aptana Studio 3, Part Deux

This is a follow up post to useful plugins for Aptana Studio. Since writing that post I have stumbled on a couple other useful plugins / tools I would like to share. Fullscreen I looked for a fullscreen plugin after being enamored with LightTable’s fullscreen feature. This plugin hasn’t been...
Read more

Book Review: Aptana Studio Beginner's Guide

Aptana Studio Beginner's Guide by Thomas Deuling covers everything in Aptana Studio from installation to setting up the built in collaborative features. Having used Aptana Studio for the past few years I still found this book helpful. It would have been great to have on my shelf when I started...
Read more

Useful Plugins for Aptana Studio 3

I have been using Aptana Studio 3 for the past few years as my primary IDE. But there are been features / plugins that I have wanted to integrate into my setup. Since Aptana is based off of eclipse I thought that finding plugins would be very easy. Turns out...
Read more

Posts Tagged in ”iowajs”

Web Components - IowaJS, Oct 2013

Looking back, jQuery UI was my first experience with “web components”. When I first discovered them I as amazed as to how easy it was to setup any widget. Just include jQuery and jQuery UI and just call the widget code. In the exsmaple below, .button() Setting up of an...
Read more

Javascript templating engines - quick overview

I recently gave a talk on javascript templating engines and was able to for the first time record it with google over air hangouts. This was one of the first presentations that I have given over javascript. I find templating a very diverse topic. It seems that there is't a...
Read more

Posts Tagged in ”book review”

Book Review: Aptana Studio Beginner's Guide

Aptana Studio Beginner's Guide by Thomas Deuling covers everything in Aptana Studio from installation to setting up the built in collaborative features. Having used Aptana Studio for the past few years I still found this book helpful. It would have been great to have on my shelf when I started...
Read more

Posts Tagged in ”opinion”

Q4, A TIME FOR REFLECTION

Software development is hard work. A project takes many turns before it’s pushed live, and sometimes you have to work more hours than you wanted and/or cut corners to hit deadlines. At ONTRAPORT, our busiest time is mid-summer into early October when we host ONTRApalooza, our annual user conference. At...
Read more

Developers Ruined the English definition of Love

A friend of my recently sent me this video It got me thinking about how language is everything when it comes to expression of self. And even more so when it comes to development and code. Which led me to this conclusion. Developers and like minded people ruined the English...
Read more

Abstractions

In the past few months, I discovered these quotes "It’s much easier to recover from no abstraction than the wrong abstraction." @sebmarkbage— getify (@getify) July 10, 2015 First you learn the value of abstraction, then you learn the cost of abstraction, then you're ready to engineer— Kent Beck (@KentBeck) October...
Read more

How and Why Developers Must Always Evolve

Back in college, my friends and I would always talk about the latest tech news. We would debate the latest and greatest ideas like which Pentium 4 processor was better. It became a competition of who ‘knew’ the most ‘stuff.’ During one of these pre-class chats, one of the guys...
Read more

Avoid Using Shorthand When Building a CSS Framework

Building a css framework is a bit different than vanilla css. Consider this css block. .box { padding: 5px 10px 5px 15px; } It’s pretty straight forward, there is nothing new here. But if you wanted to override the padding value using shorthand you would have to do something like...
Read more

Trying new ideas

When I was a kid my mother always encouraged me to try new things. From taking up a musical instrument to playing sports she was always pushing me to explore the world around me. I never understood why. I thought she was trying to get my two brothers and I...
Read more

@HACK, Raising the visibility of hacks in code

I recently read shame.css by Harry Roberts. I thought it was a very good article and touched on some points that we as developers have to deal with on daily basis. Hacks typically don't have enough visibility in the code base. What if your project spans different languages? What works...
Read more

Posts Tagged in ”jekyll”

Minifying CSS in Jekyll with cssify and strip_newlines

I recently discovered that Jekyll now supports SCSS and SASS files. Which is pretty cool because before you couldn’t use easily use them with github pages. Kevin Sweet the developer who wrote the filters for jekyll 2.3.0 breaks them down in this post In his example you can inline scss...
Read more

Export your Drupal content to Jekyll using PHP

Just this past week I migrated this blog over to Jekyll from Drupal. I had been using Drupal for the last couple years and I was getting frustrated with how many steps it took to post articles. So I decided to make the switch. Looking that the sparse Jekyll documentation...
Read more

Posts Tagged in ”personal”

Julia is Home!

After two long weeks, Julia was finally discharged from the University of Iowa Hospitals and Clinics on Thursday May 30th. What a great 2 week birthday gift! The last few days were very busy as all the doctors and therapists were in and out doing their final check ups on...
Read more

Julia Baird's Rough Start

On Thursday May 16, 2013 at 4:17pm, Jesse and Teresa Baird became parents to a beautiful baby girl, Julia Michelle Baird. She was 6 pounds and 5 ounces and was 20 inches long. She was born at Covenant Hospital in Waterloo, Iowa. Unfortunately we had a sad turn of events...
Read more

Posts Tagged in ”html”

Posts Tagged in ”windows”

Wallpaper Collection

Over the past year I have spent a bit of time every week finding interesting backgrounds for my desktop. I was increasingly getting annoyed with the amount of time I was spending on this never ending project. So I decided to roll my own Windows 7 theme with the backgrounds...
Read more

Chromecast Style Windows 7 Sidebar Gadgets

I’ve had a Google Chromecast for a couple of months, one of the things that I really like about it is how the time was displayed in the bottom left corner. So I decided to create a set of windows sidebar gadgets that look like they would fit on the...
Read more

My Picks for Windows 7 Gadgets

Since Windows 7 was released Microsoft has taken down the live gadget gallery making it harder to find quantity Windows 7 gadgets. I still use Windows 7 as my primary OS and I find the gadgets very handy. Every time I have to do a fresh install I find my...
Read more

Posts Tagged in ”running”

4 Running Tips

I like to run every day. Here are some of cool things that I have discovered over the years. If you have never used a foam roller you’re missing out. I was having troubles with my lower legs, specifically my achilles was over tight to the point where stretching wasn’t...
Read more

Posts Tagged in ”git”

Posts Tagged in ”ontraport”

Creating Themes for Ontraport/OfficeAutoPilot Forms

Ontraport / OfficeAutoPilot’s formeditor is pretty powerful, it’s great for creating one off designs. But did you know that you can use it to create themes that you can apply to other formeditor created forms? This setup will work on Wordpress, Landing Pages and plain old html pages. Quick Demo...
Read more

Posts Tagged in ”android”

Installing Android x86 on a Gateway LT21 Netbook

A few years back I jumped on the netbook craze and bought the Gateway LT21. I was pretty cool to have a small computer that actually had 8 hours of battery life. But in the last year or so, It became un-usably slow running windows / linux. Leaving it to...
Read more