This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadScript(url, callback){ | |
var script = document.createElement("script") | |
script.type = "text/javascript"; | |
if (script.readyState){ //IE | |
script.onreadystatechange = function(){ | |
if (script.readyState == "loaded" || | |
script.readyState == "complete"){ | |
script.onreadystatechange = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.InteractiveObject; | |
import flash.display.Sprite; | |
import flash.events.Event; | |
import flash.events.EventDispatcher; | |
import flash.events.MouseEvent; | |
import flash.geom.Rectangle; | |
public class ScrollBarLite { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//requires the RGB class which can be found at the following link: | |
//https://gist.github.com/nicholasdunbar/8812643 | |
//layerToTint.transform.colorTransform has to initialized to some color before this will work. | |
function addColorToLayer(layerToTint:DisplayObject, hexVal:String):void{ | |
var colorTransform:ColorTransform = new ColorTransform(); | |
var newColor:uint; | |
var rgb:RGB = new RGB(); | |
var rgb2:RGB = new RGB(); | |
var rgb3:RGB = new RGB(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RGB | |
{ | |
//r the red channel | |
public var r:uint; | |
//the green channel | |
public var g:uint; | |
//the blue channel | |
public var b:uint; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var foundIndex:int; | |
if (theArray && theArray.length > 0){ | |
var len:int = theArray.length; | |
for (var i:int; i < len; i++){ | |
if (i+1 < len){ | |
foundIndex = theArray.indexOf(theArray[i], i+1); | |
} else { | |
foundIndex = -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//here is a simple example on how to detect your content is running in an IFRAME | |
<script type="text/javascript"> | |
if(location.href != top.location.href){ alert('the content has been loaded into an IFRAME');} | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hours_to_dec() { | |
//these are all the variables we are using with an indicator of each's type. | |
// reference to active spreadsheet object | |
var ss = {}; | |
// which sheet in the spreadsheet object will we be using | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Dining Room Model and Datastore layer | |
* @author nicholasdunbar | |
* | |
*/ | |
define('DB_NAME', 'test'); | |
define('DB_USER', 'root'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//I changed the function from the following: | |
function _ad_channel_save_node($node) { | |
// delete old channel information, then add new | |
db_query('DELETE FROM {ad_channel_node} WHERE nid = %d', $node->nid); | |
$channels = _ad_channel_get_enabled($node); | |
foreach ($channels as $chid) { | |
db_query('INSERT INTO {ad_channel_node} (chid, nid) VALUES(%d, %d)', $chid, $node->nid); | |
} | |
if (user_access('configure ad premier status')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Virtual Hosts | |
# | |
# If you want to maintain multiple domains/hostnames on your | |
# machine you can setup VirtualHost containers for them. Most configurations | |