Category Archives: Programming

Simple Countdown Timer and Stopwatch with Laps for Bash

There are a lot of decent, small shell scripts for creating a simple timer or simple stopwatch. Yet, I needed a bit more than the ones I found on Google, so of course, I made some of my own.

My simple stopwatch for Bash lets you create laps, pause and gives you a total elapsed time. Keep in mind, it’s all presented in seconds.

stopwatch with laps for bash

My simple timer for Bash just countdowns the number of seconds you provide and then beeps. Like my stopwatch script, it’s all based on seconds so that there aren’t a bunch of command line arguments to deal with.

countdown timer for bash

Cordova Tip: Automatically Open Web Inspector for iOS Simulator

How many times have you painfully, manually opened Safari Web Inspector after starting the iOS Simulator with `cordova emulate`? Too often. Me too. No more.

I found a nifty osascript gist then tweaked it a little and put it inside a shell script `ios-sim-inspector`.

Then, I added a couple of new Cordova aliases to my bash profile (leveraging a couple of existing aliases)


## Existing Aliases ##

# Run iOS Simulator
alias corem="killall Simulator || echo && cordova emulate"

# Build and Run iOS Simulator
alias corbem="killall Simulator || echo && cordova build && cordova emulate"


## New Aliases with Web Inspector'ing ##

# Run iOS Simulator with Safari Web Inspector (for Debugging)
alias coremd="corem && ios-sim-inspector"

# Build and Run iOS Simulator with Safari Web Inspector (for Debugging)
alias corbemd="corbem && ios-sim-inspector"

Now you know how to painlessly open Safari Web Inspector after starting the iOS Simulator with Cordova emulate from the command line.

Free Currency Converter for Your Website

a long time ago, i was looking for some currency conversion code, be it JavaScript or some server side code utilizing some public web service. to be honest there just wasn’t anything very decent for use inside your own website… not without paying of course. i wasn’t looking for an official and up to the minute foreign exchange service, just something a little better than what a dev like myself might hack up on the cheap.

thankfully i found exactly what i was looking for.. an unbranded currency converter that i could embed into my pages via an iframe. where do you think i got it from? you know… who else gives away more useful web tools that others charge for than… Google. i bet it’s even an up to the minute quality too… but i’m not making any promises. anyhow, i just figured there might be many of you out there like myself searching for ‘free website currency converter’ ‘iframe currency converter’ ‘currency conversion script’ or something similar. so here’s the best i’ve found.. free of charge :)

http://www.google.com/finance/converter

FIX FOR: SQL Express 2008 x64, file is corrupt during install

while setting up a new windows virtual server on the rackspace cloud i ran into a hiccup. not with rackspace, so far i’m liking their setup even though it’s still in beta mode for windows. the problem actually came about with installing microsoft’s sql express 2008 x64. the installer seemed to download without any problems, all 600MB of it, but when i ran the installer (actually a self extracting cabinet file) it would get 2/3 complete and then pop a message box with “File is corrupt.” so, i’m thinking.. that’s odd that i downloaded it straight off microsoft.com. so, i google the error message real quick.. i’m still addicted to google so no bing action. google came back with tons of discussions regarding this problem, many of them on m$ sites… google “sql express 2008 file is corrupt during install” and see for yourself. the only problem is that none of those discussions had a real solution. people, like myself, were upset with many of the m$ tech responses… paraphrasing: “just keep downloading it until it works.. something is probably wrong with your anti-virus software.” no help.

ultimately here’s what worked for me: i realized that because i was downloading the sql express 2008 software from the web server.. i was using the IE browser (because i didn’t have chrome or ff installed on it.. no need). however, i wasn’t just using IE.. i was using the 64 bit version of IE. i remember long ago, with vista x64 that the 64 bit version of IE corrupted every executable I tried downloading.. so i quit using the 64 bit version and stuck with the old trusty 32 bit version. anyhow, i just downloaded sql express 2008 x64 using the 32 bit version of IE and ta-da no more “file is corrupt.”

i’m too busy to login to all those sites discussing this problem, but hopefully anybody searching for a solution to “file is corrupt” when installing sql express 2008 will find this blog entry and save themselves some time and frustration.

Website Uptime Monitoring

lately i’ve been moving a number of my websites to new hosting providers. downtime was not my motivation for moving the sites, however after hosting most of those sites with one particular company for 10 years to hosts whom i have no personal experience, uptime is concern #1. with hosting companies you never know exactly what you’re getting until you’ve been running for a while, sometimes for several years :)

i’ve used free uptime monitors for a couple of websites in the past, but i’ve never noticed any problems that would encourage actually paying for better service. during the recent moves however, it has become very clear that i can’t afford to not have thorough monitoring in place. so, if you’re comparing uptime monitoring services and stumbled on this blog i’ll just say you absolutely have to consider pingdom. at work we use another service that our sys admin likes, but it was a little more expensive. he’s going to take a look at pingdom too and see if we can save a little bread and still get the same quality of service.

pingdom doesn’t just ping. it monitors all the other fun stuff too: http, https, tcp port, dns, udp, stmp, pop3, imap, post data and will check for specific strings on a resulting page. you can get notifications via email, sms, twitter and iphone.

money well spent..

Google can crawl Javascript

Micro$oft might be spending $100,000,000 dollars to convince you that they have developed a better search engine than Google, but Google’s I/O conference stirred up some conversations about the ability of Googlebot to crawl JavaScript. That’s a tremendous step forward for search engines. If it’s true it’s also a serious game changing feature; one that should shush those (like myself) who’ve been saying that Google has been neglecting it’s search engine and focusing too much on all the other stuff they’ve been building, buying and giving away. So, it seems that yes Google can and does crawl JavaScript.

Here are some articles that SEO experts should check out.. and you’ll get a whiff of how important JavaScript crawling is:

http://searchengineland.com/google-io-new-advances-in-the-searchability-of-javascript-and-flash-but-is-it-enough-19881

http://www.seomoz.org/blog/no-clarification-forthcoming-from-google-on-nofollow-pagerank-flow

http://searchengineland.com/google-loses-backwards-compatibility-on-paid-link-blocking-pagerank-sculpting-20408

Google Lengthens Snippets, But The Meta Description Still Important

So recently Google officially released longer snippets on search results. There has been some chatter about this depreciating the value of the meta description. I have to play spoiler here and say I disagree.

The extended snippet stuff is great for long tail queries, like the many that I do when looking for programming information. Yet I don’t think it changes the importance of the meta description tag, especially for shorter search phrases.

Short snippets indicate tighter keyword proximity within the optimization of content; more precisely what the searcher is looking for. Longer snippets are only displayed when the keyword proximity is wider, therefore the content might not be precisely what the search is looking for, so that the searcher can better determine if the content on each page might have what they’re searching for.

Here’s some examples of tight keyword proximity within the content of the ranked pages, resulting in mostly short snippets:

“asp.net response.cookie expiration”

“Austin rodeo tickets”

Here’s some examples of loose keyword proximity within the content of the ranked pages, resulting in many long snippets:

“asp.net response.cookie expiration not working”

“can i watch the austin rodeo on tv”

So I stand by my opinion that body content and title tag are equally the best places to optimize for keywords and phrases to increase rankings, while the meta description is the best place to encourage a click through.

Embed HULU videos into WordPress

ok first if you’re not familiar with HULU… check it out. a while back NBC told Steve Jobs ‘no thanks, we’ll distribute our own online videos.’ you can bet that HULU also had a lot to do with the writers strike not too long ago. anyhow it’s an awesome service for online video freaks.

this post is however geared towards WordPress bloggers who want to embed HULU videos into their blogs. i found a HULU WordPress Plugin and figured i’d share it with you as well as a sample clip here on my blog.

here’s the first episode from ‘Start-up Junkies’ a show i watched on MOJO HD that i really enjoyed.