Category: Code

Programming script for FTM100DR and FTM400DR

I recently installed the new Yaesu FTM100DR radio in my car, and it’s not currently supported by any open source programming software. RT Systems has some programming software, but it only runs on windows, and it’s kinda stupid expensive. I found a utility by KZ7ZZZ over at the forums that reads Yaesu’s .dat file and…

Dynamically generate searchable sortable tables.

Frequently throughout my pages I like to print out reports of data. The jquery tablesorter plugin is an excellent way to take this tabular data and make it sortable by column. However, since I do this so frequently, I wanted to create a script that would set up the plugin and add some other features,…

Bash MySQL function

I use this function to run SQL queries from bash scripts. [code lang=”bash”] fRunQuery(){ # This function should always be preceeded by a SQL statement # Loaded into the variable SQL # ie) SQL="SELECT * FROM table"; fRunQuery # The results of the query will be loaded into the variable # $RESULT: RESULT=`mysql –skip-column-names -h${dbhost}…

Javascript to format date like mm/dd/yyyy hh:mm:ss

[code lang=”js”] var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1;//January is 0! var yyyy = today.getFullYear(); var hours = today.getHours(); var minutes = today.getMinutes(); var seconds = today.getSeconds(); if(dd<10){dd=’0’+dd} if(mm<10){mm=’0’+mm} d=mm+’/’+dd+’/’+yyyy+’ ‘+hours+’:’+minutes+’:’+seconds [/code]

AJAX waiting indicator

The following code snippet will display a waiting indicator during any AJAX request. [code lang=”js”] //Adds a wait indicator to any ajax requests $(‘body’).ajaxStart(function() { $(‘#loading’).show(); }); $(‘body’).ajaxStop(function() { $(‘#loading’).hide(); }); [/code]