Skip to content

Instantly share code, notes, and snippets.

@tdm00
tdm00 / sample.js
Created June 12, 2014 04:17
CasperJS sample test file
var url = 'http://www.msu.edu';
casper.test.begin('Lookup homepage', 1, function suite(test) {
casper.start(url, function() {
test.assertHttpStatus(200, "Web server returned page correctly");
test.assertTitle('Michigan State University');
});
casper.run(function() {
test.done();
On Thursday April 23 I have promptly escaped from a maximum security office in the Eyde building to the Lansing underground until Monday April 27. Today, still wanted by people like you emailing me, I survive as a person taking a vacation day. If you have a problem, if no one else can help, and if you can find a phone, maybe you can reach me at 517-884-XXXX.
Dun da Dun Daaa Dun dun duhhhh
https://www.youtube.com/watch?v=PIfuaUTH9Y4
@tdm00
tdm00 / gist:1204137
Created September 8, 2011 18:07 — forked from lincolnthree/gist:1204112
Bootstrap
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Social PM</title>
<link rel="stylesheet" href="bootstrap-1.1.0.css">
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script src="application.js"></script>
</head>
<body>
@tdm00
tdm00 / gist:1204195
Created September 8, 2011 18:30 — forked from lincolnthree/gist:1204112
Bootstrap
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><link type="text/css" rel="stylesheet" href="/socialpm-web/javax.faces.resource/bootstrap.css.xhtml" /><link type="text/css" rel="stylesheet" href="/socialpm-web/javax.faces.resource/docs.css.xhtml" /><link type="text/css" rel="stylesheet" href="/socialpm-web/javax.faces.resource/prettify.css.xhtml" />
<title>SocialPM » New Project</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Cache-Control" content="must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="Mon, 1 Aug 1999 10:00:00 GMT" /><script type="text/javascript" src="/socialpm-web/javax.faces.resource/prettify.js.xhtml"></script><script type="text/javascript" src="/socialpm-web/javax.faces.resou
@tdm00
tdm00 / index.html
Created January 11, 2012 17:34
Redirect for CIS
<script type="text/javascript">
<!--
window.location = "https://cis.bric.msu.edu/CIS";
//-->
</script>
@tdm00
tdm00 / Call.cfc
Created February 23, 2012 20:34
Single Table Inheritance & Nested Properties
<cfcomponent extends="Model" output="false">
<cfset this.modelName = ListLast(GetMetaData(this).name, ".")>
<cffunction name="init">
<!--- Model Validations --->
<cfset validatesPresenceOf(properties="callstatusid") />
<!--- Associations --->
<cfset hasMany(name="taggings", dependent="deleteAll", shortcut="tags") />
@tdm00
tdm00 / requisitiontests.cfc
Created April 6, 2012 21:30
requisitiontests/create
<!--- requisitiontests/create --->
<cffunction name="create">
<!--- Create a Requisitiontest object based on the values passed from the form --->
<cfset requisitiontest = model("Requisitiontest").new(params.requisitiontest)>
<!--- Verify that the requisitiontest creates successfully --->
<cfif requisitiontest.save()>
<!--- Next create a recordset of the questions that go along with that test --->
<cfset questions = model("testquestion").findAll(
where="testid=#requisitiontest.testid#",
include="answerlist(answerlistoptions)",
@tdm00
tdm00 / requisitiontests.cfc
Created April 9, 2012 16:27
Refactored Requisitiontests.cfc
<!--- requisitiontests/create --->
<cffunction name="create">
<!--- Create a Requisitiontest object based on the values passed from the form --->
<cfset requisitiontest = model("Requisitiontest").new(params.requisitiontest)>
<!--- Verify that the requisitiontest creates successfully --->
<cfif requisitiontest.save()>
<!--- Next create a recordset of the questions that go along with that test --->
<cfset questions = model("testquestion").findAll(
where="testid=#requisitiontest.testid#",
<% if @user.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
@tdm00
tdm00 / README.md
Created June 11, 2012 04:02
Gist 1
# Define legacy table information
# self.table_name = "tblDoctor"
# self.primary_key = "DoctorID"
# alias_attribute :first_name, :DoctorFName
# alias_attribute :last_name, :DoctorLName
# alias_attribute :middle_name, :DoctorMName
# alias_attribute :suffix, :DoctorSuffix
# alias_attribute :title, :DoctorPrefix
# alias_attribute :hospital_id, :HospitalID
# alias_attribute :address1, :DoctorAddress1