Skip to content

Instantly share code, notes, and snippets.

View bballentine's full-sized avatar

Brandon Ballentine bballentine

View GitHub Profile
@bballentine
bballentine / PSCC Accordian FAQ Sample
Created July 14, 2017 16:29
Reference code for creating new FAQ content in Cascade using the standard page template.
<div aria-multiselectable="true" id="accordion" role="tablist">
<div class="card">
<div class="card-header" id="heading-1" role="tab">
<h3 class="mb-0"><a aria-controls="collapse-1" aria-expanded="true" data-parent="#accordion" data-toggle="collapse" href="#collapse-1"> What is my P Number?
</a></h3>
</div>
<div aria-labelledby="heading-1" class="collapse show" id="collapse-1" role="tabpanel">
<div class="card-block">
<p>This is where the actual text goes</p>
</div>
<html
xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"/>
<system-page-meta-keywords/>
<system-page-meta-description/>
<meta content="Pellissippi State Webmaster" name="author"/>
<title>Pellissippi State Community College</title>
@bballentine
bballentine / Middleware
Created April 26, 2017 18:06
Vapor - Example middleware that checks user's role before giving access to protected resources.
import Vapor
import HTTP
public class AdminAuthMiddleware: Middleware {
public let error: Error
public let authLevel: UserRole
public init(error: Error, authLevel: UserRole) {
self.error = error
self.authLevel = authLevel
}
@bballentine
bballentine / Quiz-Footer.html
Created July 9, 2013 13:11
D2L Replace Strings Example - Quiz Footer
@bballentine
bballentine / Help-Widget.html
Created July 9, 2013 13:10
D2L Replace Strings Example - Help Widget
<!-- Create a new custom widget and place the following code in the Content area -->
<h2>Need help? Having trouble?</h2>
<ul>
<li><a href="/Shared/documentation/help.html?role={rolename}" target="_blank">Online Help</a></li>
<li><a href="#">Quick Reference Guides</a></li>
<li>Call the HelpDesk (865.694.6537) or <a href="#">email them</a></li>
</ul>
@bballentine
bballentine / Course-Welcome.html
Created July 9, 2013 13:10
D2L Replace Strings Example - Course Welcome
<p>Hi, {FirstName} and welcome to {OrgUnitName}. We're going to have a great time this semester. Please take a few minutes to look through Module 1 in the <strong>Course Content</strong> area, where you'll find the Syllabus and Course Schedule.</p>
@bballentine
bballentine / Conditional-Release.html
Created July 9, 2013 13:09
D2L Replace Strings Example - Conditional Release
Hi {FirstName}. It looks like you didn't do so well on the Unit 1 test. For the next exam, you may want to spend some additional time looking at the Study Guide and Practice Test. Please get in touch if you have any questions!
@bballentine
bballentine / Mobile Redirect
Created April 16, 2013 13:57
Simple redirect for iOS and Android
<?php
if( strstr([‘HTTP_USER_AGENT’],’iPhone’) || strstr([‘HTTP_USER_AGENT’],’iPod’) || strstr([‘HTTP_USER_AGENT’],’Android’) ) {
header(‘Location: http://www.google.com');
exit();
}
?>
@bballentine
bballentine / geolocation-high-accuracy.html
Created April 8, 2013 17:23
WEB 2710 Geolocation Example
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script>
$(function() {
// code to run when the document is ready
if (Modernizr.geolocation){
$("p.check4location").html("Congratulations, your browser supports Geolocation!").addClass("locationSuccess");
navigator.geolocation.getCurrentPosition(
@bballentine
bballentine / Picturefill Example
Created March 4, 2013 21:16
PictureFill Example
<div data-picture data-alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
<div data-src="small.jpg"></div>
<div data-src="medium.jpg" data-media="(min-width: 400px)"></div>
<div data-src="large.jpg" data-media="(min-width: 800px)"></div>
<div data-src="extralarge.jpg" data-media="(min-width: 1000px)"></div>
<!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. -->
<noscript>
<img src="external/imgs/small.jpg" alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
</noscript>