Skip to content

Instantly share code, notes, and snippets.

@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 / gist:1207477
Created September 9, 2011 22:18
Bootstrap Floating Top-bar
<div>
<div class="topbar">
<div class="topbar-inner">
<div class="container">
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle">Dropdown</a>
<ul class="dropdown-menu">
<li><a href="#">Item1</a></li>
<li><a href="#">Item2</a></li>
@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
@tdm00
tdm00 / file.rb
Created June 21, 2012 16:21
Ruby String Interpolation
user.log.create(:description => 'viewed report #{@report.test.accession}')