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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
<html> | |
<head> | |
<title>SIMBOX EXAMPLE</title> | |
<style> | |
.black_overlay{ | |
display: none; | |
position: absolute; | |
top: 0%; | |
left: 0%; |
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 autoTitleTooltip = function(){ | |
var elementType = 'div'; | |
var customClass = ''; | |
domIdFromString = function(myStr){ | |
myStr+=Math.random(); | |
myStr=myStr.toLowerCase(); | |
myStr=myStr.replace(/ /g,""); | |
myStr=myStr.replace(/[^a-zA-Z0-9]+/g,""); |
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
/* major redo! now it works! and works well... */ | |
function pushValue(domId, newValue){ | |
if (jQuery){ | |
jQuery("#" + domId).html(newValue); | |
}else{ | |
document.getElementById(domId).innerHTML = newValue; | |
} | |
} | |
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
static function replace_tags($full_text,$data_objects_array){ | |
//using key => value pairs replace tag_names with object_sttributes | |
/* Example Object | |
* | |
* $object["user"] = $user; | |
* $object["dealer"] = $dealership; | |
* $awesome_text = replace_tags($tagged_text,$object); | |
*/ | |
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 page = require('webpage').create(), | |
address, output, size, timeOut, loops, cnt; | |
if (phantom.args.length < 2 || phantom.args.length > 6) { | |
console.log('Usage: westerize.js URL filename [timeout] [repeat] [width] [height]'); | |
console.log(' timeout: miliSeconds'); | |
console.log(' repeat: how many images to take'); | |
console.log(' width/height: defaults to 1024x768'); | |
phantom.exit(); | |
} else { |
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 sys = require('sys'), | |
http = require('http'), | |
io = require('socket.io'), // for npm, otherwise use require('./path/to/socket.io') | |
fs = require('fs'); | |
var pageContent = ''; // content of the client page | |
// create web server and reply the client page on http request | |
var server = http.createServer(function(req, res){ | |
res.writeHead(200, {'Content-Type': 'text/html'}); |
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 linkify(textBlock){ | |
return textBlock.replace(/&/g, '&') | |
.replace(/</g, '<') | |
.replace(/>/g, '>') | |
.replace(/(^|<|\s)(www\..+?\..+?)(\s|>|$)/g, '$1<a href="http://$2">$2</a>$3') | |
.replace(/(^|<|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|>|$)/g, '$1<a href="$2">$2</a>$5'); | |
} |
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
html { | |
background: url(images/bg.jpg) no-repeat center center fixed; | |
-webkit-background-size: cover; | |
-moz-background-size: cover; | |
-o-background-size: cover; | |
background-size: cover; | |
} |
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
Object.prototype.count = function () {var count = 0; for(var prop in this) { if(this.hasOwnProperty(prop)) count = count + 1;}return count;} |
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
// Turn a (possibly) relative URI into a full RFC 3986-compliant URI | |
// With minor modifications, courtesy: https://gist.github.com/Yaffle/1088850 | |
function absoluteUri(base, href) { | |
// Parse a URI and return its constituent parts | |
function parseUri(url) { | |
var match = String(url).replace(/^\s+|\s+$/g, '').match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); | |
return (match ? { href: match[0] || '', protocol: match[1] || '', authority: match[2] || '', host: match[3] || '', hostname: match[4] || '', | |
port: match[5] || '', pathname: match[6] || '', search: match[7] || '', hash: match[8] || '' } : null); | |
} |