/* BeejBløg */

Mar 29, 2016 - 2 minute read - Comments -

Knockout-Validation lib – clean patterns

Knockout-Validation on GitHub which also leverages the jQueryValidation lib All Bootstrap v3 compatible Coolest architectural nugget = applying validation rules to VM observables (not inside HTML markup) one clear reason why that is a better way -> when the VM field is bound to multiple UI points, you only define the rule once vs many var myVM = function() { var self = {}; // simple required self.orderId = ko.

Mar 16, 2016 - 1 minute read - Comments -

Shred GPX WPT XML with SQL Server

declare @xml xml = ‘ <wpt lat="35.0977419" lon="-80.89258"> <name>10112 Industrial Dr. Pineville, NC 28134, Pineville, NC, 28134</name> <desc>10112 Industrial Dr, Pineville, NC 28134, USA</desc> </wpt> <wpt lat="30.8276466" lon="-83.9967315"> <name>323 Industrial Blvd Thomasville, GA 31792, Thomasville, GA, 31792</name> <desc>323 Industrial Blvd, Thomasville, GA 31792, USA</desc> </wpt> <wpt lat="26.4237949" lon="-81.415628"> <name>283 E Jefferson St Immokalee, FL 34142, Immokalee, FL, 34142</name> <desc>283 Jefferson Ave E, Immokalee, FL 34142, USA</desc> </wpt> </gpx>' SELECT n.

Mar 2, 2016 - 1 minute read - Comments

WordPress – show all Tags in Cloud

wordpress defaults to only showing the first 45 tags tweak this file => \wp-includes\widgets\class-wp-widget-tag-cloud.php add the “number=0” parameter to this code: /** * Filter the taxonomy used in the Tag Cloud widget. * * @since 2.8.0 * @since 3.0.0 Added taxonomy drop-down. * * @see wp_tag_cloud() * * @param array $current_taxonomy The taxonomy to use in the tag cloud. Default 'tags'. */ $tag_cloud = wp_tag_cloud( apply_filters( 'widget_tag_cloud_args', array( 'taxonomy' => $current_taxonomy, 'echo' => false, 'number' => 0 ) ) );  

Mar 1, 2016 - 1 minute read - Comments -

Knockout, Validation, Bootstrap skinned File Input

  Visual example: Highlights: Skinning the native html <input type=“file”> by setting it’s opacity=0 and positioning above a bootstrap skinned button… this way when you click the pretty button you’re really clicking on the invisible native button which launches the file open dialog as usual, cool! :) Bootstrap input-group aesthetically bundles the visual elements – file button, filename box, valiation message and clear button Knockout Custom Binding on the file input change event to save into VM observable Knockout-Validation lib to require selected file to be an image type – nice thing here is keeping that logic in the js ViewModel vs dirtying the html with it.

Feb 9, 2016 - 1 minute read - Comments

HTML5 Canvas based 3d Tag Cloud

This Goat1000.com guy has provided an amazingly comprehensive 3d library… the configuration options are endless. <!--[if lt IE 9]><script type="text/javascript" src="excanvas.js"></script><![endif]--> <script src='//www.goat1000.com/jquery.tagcanvas.min.js' type='text/javascript'/> <script type="text/javascript"> $('#canvas3dTagCloud').tagcanvas({ textColour : '#000', outlineThickness : 2, maxSpeed : 0.03, depth : 0.75, zoom: 1.15, weight: true, weightFrom: "data-weight", weightSize: 5 }); </script> Below needs to be edited for your particular blog engine’s syntax for looping over tags (Google Blogger sample). Due to internal use of getElementById, it appears our canvas element must be targeted via an #Id selector in above jquery (i.

Jan 26, 2016 - 1 minute read - Comments

WordPress Append HashTag to PermaLink

Motivation: Running a site with a big banner header — of course this decision must be weighed itself — on a user screen with low vertical res (e.g. 1024 x 768), the homepage would only show the header link of the first post summary (we’re also using “Add Posts to Page” plugin, with it’s ‘read more’ summary function)… clicking on the post would then nav to relatively same thing, staring at a big banner.

Nov 23, 2015 - 5 minute read - Comments -

Sizing a Battery Backup (aka UPS)

I live in the Seattle area, apparently we get a nice windy storm around every Thanksgiving… sure to form, we lost power for a nice long 24 hours starting 11/17/2015… so i finally ordered a low end generator… and then i started wondering about including a UPS for computer up-time continuity during the momentary brownouts that happen when the wind is jacking with our power grid. Power Requirements nice reference Typical UPS units will be rated in VA (Volt-Amps) aka Apparent Power … and possibly in Watts aka Real Power as well The difference between these two comes from concept called Power Factor… PF = Real / Apparent… quick backgrounder: a “purely resistive” load like an old school incandescent light bulb will have a PF = 1 where VA and Watts are equal whereas the typical implementation of AC to DC in a PC PSU represents an inductive load which causes the Amperage sine wave to lag behind the Voltage yielding a PF < 1 where some energy is “lost” – helpful physical analogy – see horse and boat – it does beg the question where this energy is actually lost to… in the physical horse/boat scenario it’s easy to think it goes to friction/kinetic but i don’t have it pinned down in the AC/DC scenario… perhaps wasted in underutilized electromagnetic field Ideally your UPS will be rated for both their VA & Watts capacity but if only VA, then it is common to expect a UPS to handle Watts at 60% of it’s VA rating … i.

Nov 20, 2015 - 2 minute read - Comments -

Transcode MOV to MP4

GitHub Source Motivation: Digital cameras and phones typically save video to MOV (Motion JPEG) files. I share my photos & videos via a self hosted open source photo gallery (zenPhoto). MOV files must be converted to a compatible format like MP4 to stream through the readily available web video players like Flowplayer. Script features: Handles multiple files at once… even from different folders, e.g. when part of a file explorer search result Applies rotation where recognized in the EXIF metadata.