Skip to content

Instantly share code, notes, and snippets.

View lazypower's full-sized avatar
💭
Bring back independent blogs, rss feeds, and the small web.

Charles "Chuck" Butler lazypower

💭
Bring back independent blogs, rss feeds, and the small web.
View GitHub Profile
// embed the Reveal script - better than trying to minify it all here -- i'll eat the cache request
document.write("<script type='text/javascript' src='http://cache.university-bound.com/olsg-script/jquery.reveal.js'></script>");
// the DOM structure to build out the modal window - keep some formatting please so when we inspect it - it doesnt look like complete markup vomit.
var ModalCode = '<div id="schoolGuideModal" class="reveal-modal large">\n\t\t<form>\n\t\t\t <img class="sg-ebook" src="http://cache.university-bound.com/olsg-script/img_sg-ebook.png" alt="Online School Guide"/>\n\t\t <h2>Frustrated By All The Online School Choices?</h2>\n\t\t <ul class="sg-list">\n\t\t \t<li>What program should you choose?</li>\n\t\t \t<li>What are the classes like?</li>\n\t\t \t<li>What are the financial aid options?</li>\n\t\t </ul>\n\t\t <div class="sg-form-body">\n\t\t \n\t\t \t<p>Start Here</p>\n\t\t \t<label for="fname">First Name</label>\n\t\t \t<input type="text" name="f
@lazypower
lazypower / SchoolPrograms2.cs
Created March 8, 2012 21:28
Subsonic -- Y U NO
public List<ProgramStructure> getSchoolPrograms(string eduComplete, string schoolCode, string areaOfInterest)
{
int eduBasement = SubQuery.getEduIDBasement(eduComplete);
int edu = SubQuery.getEduID(eduComplete);
int schoolid = SubQuery.getSchoolID(schoolCode);
int areaOfInterestID = SubQuery.getAOIID(areaOfInterest);
var Programs = from p in Program.All()
join d in Degree.All() on p.DegreeID equals d.DegreeID
join dc in DegreeCategory.All() on d.DegreeCategoryID equals dc.DegreeCategoryID
@lazypower
lazypower / gist:2136059
Created March 20, 2012 14:18 — forked from mikebosco/gist:2136049
DeterminePath degrees join fails it
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dev.Data;
namespace UBoundTools.Database.LMP
{
public class DeterminePath
{
@lazypower
lazypower / ObjectCopy.vb
Created March 24, 2012 01:25
Use reflection to copy existing properties from object to object
Imports System.Reflection
Public Class ObjectCopy
''' <summary>
''' Copies an objects properties and fields from the source to destination
''' </summary>
''' <param name="newType">The BaseType you are copying from</param>
''' <param name="source">The source object copying FROM</param>
''' <param name="destination">the destination object copying TO</param>
@lazypower
lazypower / LB_Zip_Validation.js
Created March 27, 2012 22:57
LiveBall Zipcode Validator Extension
var LB = window.LB || {};
LB.validate = {
"form": document.liveballform,
"zip": document.liveballform.addresszip,
"message": 'The "ZipCode" is not a valid choice.',
"validArray": ["85001","85002","85003","85004","85005","85006","85007","85008","85009","85010","85011","85012","85013","85014","85015","85016","85017","85018","85019","85020","85021","85022","85023","85024","85025","85026","85027","85028","85029","85030","85031","85032","85033","85034","85035","85036","85037","85038","85039","85040","85041","85042","85043","85046","85050","85051","85053","85054","85055","85060","85061","85062","85063","85064","85065","85066","85067","85068","85069","85070","85071","85072","85073","85074","85075","85076","85078","85079","85080","85082","85083","85085","85086","85096","85098","85250","85251","85252","85253","85254","85255","85257","85258","85259","85260","85261","85266","85267","85269","85271","85280","85281","85282","85287","85301","85302","85303","85304","85305","85306","85307","85308","85309","85310","85311",
$: << File.dirname(__FILE__) # for 1.9
# log in using the login example, so we don't have to duplicate code
require 'login'
# get the root of the folder structure
root = @account.root
# list all of the folders in the root directory with their index
root.folders.each_with_index do |folder, i|
@lazypower
lazypower / install.sh
Created April 7, 2012 21:18
Automate the deployment of your own TShock server
#!/bin/bash
apt-get -y install mono-complete
#Force removal of the directory if it exists
rm -rf /tmp/terraria
mkdir /tmp/terraria
#create the cache
source 'https://rubygems.org'
gem 'redcarpet'
gem 'pdfkit'
package week3lab2;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collections;
import javax.swing.*;
@lazypower
lazypower / SeleniumReference.md
Created May 16, 2012 04:24
Handy Selenium Syntax

echo

Outputs the exact phrase put into the statement. Eg: echo "Now checking validation" will cause a new line, the phrase "Now checking validation" to be printed, another new line and then the output of the test. Handy when reviewing logs to separate multiple test cases.

open

tells the browser to open a specific page. This is useful if you don’t want the test to navigate to a page and instead just want it to go straight there. This can be a relative path so you can use it on both a testing and live environment.