status

Geddy, Assets Addon

I wrote an assets add-on for Geddy.  Basically, ithis add-on allows you to modify the header of the page and add scripts, css files or change the title on the fly.

Installation


Step 1
Copy the Assets.js file to your controllers directory .

Step 2
Add two lines to the file app/controllers/Application.js.
var Assets = require(process.cwd() + '/app/controllers/Assets').Assets;

var Application = function () {
	this.Assets = new Assets();
};

exports.Application = Application;

Step 3
Next you need to modify app/views/layouts/application.html.ejs
...
<title><%= Assets.title(); %></title>
...
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<%- Assets.script(); %>
...
<link rel="stylesheet" href="/css/bootstrap.responsive.min.css">
<%- Assets.css(); %>
...
</div>
<%- Assets.preload(); %>
</body>

Step 4
Modify the controller you want to add Assets to. app/controllers/myFile.js
...
this.login = function (req, resp, params) {
     this.Assets.title('Registration Verification | Login');
     this.Assets.script(['myscript.js', 'myscript2.js']);
     this.Assets.css('mystyles.css');
     this.Assets.preload(['img1.jpg', 'img2.jpg']);

     this.respond({params: params, Assets: this.Assets});
}
...
* Take special note of the respond line and how I have added the assets to it.

Optionally you can use the load method
this.Assets.load({
	title:   'Registration Verification | Login',
	script:  ['myscript.js', 'myscript2.js'],
	css:     ['mystyles.css', 'mystyles2.css'],
	preload: ['mystyles.jpg', 'mystyles2.jpg']
})
    		
this.respond({params: params, Assets: this.Assets});


  Assets.js (unknown, 295 hits)

26
Apr 2012
POSTED BY Matthew
POSTED IN

General, Javascript

DISCUSSION No Comments
image

What Happened

Technical Support Error

The databaese server that was attached to the old site got corrupted somehow. As a result, I’ve had to revert to an old backup copy of the site, some of the links may not work properly yet but they will all be fixed as soon as possible.

26
Jan 2012
POSTED BY Matthew
POSTED IN

News

DISCUSSION No Comments
status

Google Maps Sidebar Widget for WordPress (Per Post)

My friends at Moss Creek Media had an idea.  They wanted to put a Google map of where a picture was taken next to the image.

I looked at all the plug ins and could only find one that added a Google map to a sidebar.  This was great! Something existed so I didn't have to build it but, it only supported one location (defined globally for every instance of the widget) and  what I needed to do was set the location according to the currently displayed image.

Modification time

The original plug-in google-map-v3-for-idn created by Raphael Berrhoun was very easy to modify. I created a new shortcode called gps that you insert into each post where the sidebar widget is displayed.

 [gps latitude="43.62132" longitude="-71.629517" description="<strong>House of Goodness</strong><br/>31 Main St<br/>Oakland, CA 12334"] 

Next all I had to do was modify some of the javascript to read the values passed in by the shortcode (should they be available). If the values were not present then it defaults to the normal values.

function makeMap() {
                        var lat = '".$lat."';
                        var lng = '".$lng."';
                        var info ='';
                        if ( (document.getElementById('gps-latitude')!='undefined') && (document.getElementById('lng')!='undefined') ) {
                             lat = document.getElementById('gps-latitude').innerHTML;
                             lng = document.getElementById('gps-longitude').innerHTML;
                             info = document.getElementById('gps-description').innerHTML;
                        }

Usage

You can download my modified the version of the plug-in. All that you will need to do is add the GPS line to your post and make sure you have installed the widget into your sidebar and populated the Google Maps API key. (Under settings in the control panel)

  mod_google-map-v3-for-idn.zip (14.3 KiB, 201 hits)

01
May 2010
POSTED BY Matthew
DISCUSSION No Comments
status

Directory Monitor

Monitor Types

  • File Created
    This gets kicked off when a file is created in the directory.  It will not wait for the fileto finish being created before the process starts.
  • After File Created
    This gets kicked off when a file is created in the directory and waits for it to finish.
  • File Deleted
    This gets kicked off when a file is deleted.

Threading

Wherever possible the program runs in a single thread environment with the exception of waiting for a file to complete.

Command-line

Two command-line options are available. -autostart and -minimize

These will automatically start the monitoring process and minimize the application to the tray.  The commandline options will
only function using the last settings you ran the program with (saved settings).

ex. dirmon.exe -autostart -minimize

Extensions

There are no periods in front of the extensions, its just a list separated by spaces, EX. bat gif jpg

  DirMon.zip (548.3 KiB, 1,310 hits)

20
Apr 2010
POSTED BY Matthew
POSTED IN

Files, General

DISCUSSION No Comments
status

Javascript Curvy Corners Mootools Version

What is CurvyCorners?

A free JavaScript library for creating gorgeous rounded corners for HTML block elements i.e. DIVs. Supports anti-aliasing, borders and background images.

Currently Firefox, Safari and Chrome have limited support for the proposed CSS3 border-radius selector.

This is an awesome library, simply include the script tag and code your css with CSS3 rounded corner properties and it automatically detects IE and rounds the corners for you.

Script tag:

<script src="js/curvycorners-moo.js" type="text/javascript"></script>
Sample CSS:
.navbar {width: 980px; border: 1px solid #555; -moz-border-radius:3px; -webkit-border-radius:3px; }

For more information please see the authors home page: http://www.curvycorners.net/

Mootools Version

There is an addEvent inside the Curvy Courners JS module, I replaced this with Mootools code so it no longer causes a conflict.

  curvycorners-moo.zip (30.4 KiB, 343 hits)

01
Apr 2010
POSTED BY Matthew
POSTED IN

Files, Javascript

DISCUSSION 1 Comment