Skip to content

Instantly share code, notes, and snippets.

View christophervigliotti's full-sized avatar
:atom:
Always be learning!

Christopher Vigliotti christophervigliotti

:atom:
Always be learning!
View GitHub Profile
@christophervigliotti
christophervigliotti / gist:f0a1fc3cdef629f65609
Created May 8, 2014 14:56
Hacky Zurb Foundation 4 Checkbox Fixer
this.writeCheckbox = function(id,value){
var doCheck = true;
var isChecked = false;
var selector = '#' + id;
if(value == 0 || value == '' || value == undefined){
doCheck = false;
}
isChecked = $(selector).parent().children("span").hasClass("checked");
@christophervigliotti
christophervigliotti / 1. index.cfm
Last active August 1, 2017 07:52
From Canvas to CFDocument via AJAX
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Canvas Image To CFDocument Via toDataURL() and AJAX</title>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
</head>
<body>
<a href="#" id="makePdfLink">Make PDF</a>, <a href="aPdf.pdf">View PDF</a>
<canvas id="myCanvas"></canvas>
@christophervigliotti
christophervigliotti / index.html
Last active August 29, 2015 14:01
Convert An SVG To Canvas (And Then To PNG)
<!DOCTYPE html>
<html>
<head>
<title>SVG > Canvas</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/canvg.js"></script>
@christophervigliotti
christophervigliotti / gist:90a9deb279f04b3fef0a
Last active August 29, 2015 14:01
Export Dygraph As PNG
<!-- you too can export dygraphs http://dygraphs.com/
as pngs by using this awesome library http://cavorite.com/labs/js/dygraphs-export/ -->
<html>
<head>
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="//dygraphs.com/dygraph-combined.js"></script>
<script type="text/javascript" src="dygraph-extra.js"></script>
</head>
<body>
<div id="graphdiv" style="width:500px; height:300px;"></div>
@christophervigliotti
christophervigliotti / cfthread.cfm
Last active August 29, 2015 14:04
CFThread Is In The House
<cfset value = '' />
<cfthread name="aThread" action="run">
<cfset value = objectInstance.method(anArgument) />
</cfthread>
<cfset sleep(5000) /><!--- wait for a bit (give the thead a chance to complete) --->
<cfif ((aThread.Status IS "RUNNING") || (aThread.Status IS "NOT_STARTED"))><!--- if the thread is not done, kill it --->
<cfthread action="terminate" name="aThread" />
<cfset sleep(500) /><!--- sleep for a bit to properly terminate the thread --->
@christophervigliotti
christophervigliotti / unexploder.js
Created July 31, 2014 23:01
unbreak my internet explorer 11...
if(typeof console == "undefined") { // for ticket 484
this.console = {log: function() {}};
}
@christophervigliotti
christophervigliotti / backbone.html
Last active August 29, 2015 14:06
Checking Out Backbone.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<ul id="theul"><li>sweet child of theul</li></ul>
<div id="thediv">thediv</div>
@christophervigliotti
christophervigliotti / overlay.css
Last active August 29, 2015 14:09
Dirt-Simple Overlay
.overlay {
background-color:white;
filter:alpha(opacity=50); /* IE */
opacity:0.5; /* Safari, Opera */
-moz-opacity:0.50; /* FireFox */
z-index:20;
height:100%;
width:100%;
background-repeat:no-repeat;
background-position:center;
@christophervigliotti
christophervigliotti / backup.sql
Last active August 29, 2015 14:13
back that thang up, where "that thang" is one or more sql server databases
DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
-- specify database backup directory (create this path if it does not exist)
SET @path = 'C:\SQL Server Data\Backup\'
-- specify filename format
@christophervigliotti
christophervigliotti / FancyModule
Created March 12, 2015 12:59
call after_save from a module
module FancyModule
extend ActiveSupport::Concern
included do
after_save :do_that_thing
end
def do_that_thing
#thing goes here
end