Skip to content

Instantly share code, notes, and snippets.

View cfjedimaster's full-sized avatar
😺
Happy, and tired.

Raymond Camden cfjedimaster

😺
Happy, and tired.
View GitHub Profile
@cfjedimaster
cfjedimaster / gist:2313466
Created April 5, 2012 19:33
Conditional jQuery resource get
<!DOCTYPE html>
<html>
<head>
<title>Conditional Get</title>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script>
$(document).ready(function() {
var theResource = "dump.zip";
@cfjedimaster
cfjedimaster / Application.cfc
Created April 6, 2012 13:16
Application.cfc
component {
this.name = "jsoup_demo";
this.javaSettings = {
loadPaths=[expandPath("./jars")]
};
}
<!--- cache it to speed it up --->
<cfif not cacheIdExists("cnnhtml")>
<cfhttp url="http://www.cnn.com">
<cfset cnnhtml = cfhttp.filecontent>
<cfset cachePut("cnnhtml",cnnhtml)>
<cfelse>
<cfset cnnhtml = cacheGet("cnnhtml")>
</cfif>
<cfscript>
<cfparam name="form.url" default="">
<cfparam name="form.selector" default="">
<form class="well" method="post">
<cfoutput>
<p>
<label for="url">URL:</label> <input type="url" name="url" id="url" required value="#form.url#">
</p>
<p>
<label for="selector">Selector:</label> <input type="text" name="selector" id="selector" required value="#form.selector#">
<cfparam name="url.files" default="">
<cfparam name="url.wrap" default="0">
<cfif not len(trim(url.files))>
<cfoutput>Files must be specified!</cfoutput>
<cfabort>
</cfif>
<cfset files = listToArray(url.files)>
<cfset extList = "js,html,css">
//a video tag
var video = document.getElementById('monitor');
//request it
navigator.webkitGetUserMedia({video:true}, gotStream, noStream);
function gotStream(stream) {
video.src = webkitURL.createObjectURL(stream);
video.onerror = function () {
function snapshot() {
$("#result").html("<p><i>Working hard for the money...</i></p>");
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
canvas.getContext('2d').drawImage(video, 0, 0);
var data = canvas.toDataURL('image/jpeg', 1.0);
newblob = dataURItoBlob(data);
<!DOCTYPE html>
<html>
<head>
<script src="cordova-1.6.0.js"></script>
<script>
var startTime;
function init() {
console.log("init");
Small gist with
<b>HTML</b> in it...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Single page template</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>