Skip to content

Instantly share code, notes, and snippets.

var v = [],
opts = ha31lib.ge('survey').getElementsByTagName('input'),
i;
for (i=0;i<opts.length;i++) {
var opt = opts[i];
if (opt.name == 'illbe') {
if (opt.checked) {
v.push(opt.id);
}
}
@tcaddy
tcaddy / crontab
Last active January 6, 2016 15:05
Linux CPU and Memory Logging
#############################################################
# Log memory and CPU usage
#############################################################
*/5 * * * * /usr/local/bin/log_memory_usage.sh > /dev/null
*/5 * * * * /usr/local/bin/log_cpu_usage.sh > /dev/null
@tcaddy
tcaddy / bbts-meal-plans.sql
Last active January 6, 2016 15:20
Meal Plan Queries
SELECT LPAD(CAST(ENVISION.CUSTOMER.custnum AS INTEGER),7,'0'),
ENVISION.BOARDPLAN.boardplan
FROM ENVISION.BOARDPLAN
LEFT OUTER JOIN ENVISION.CUSTOMERBOARD ON ENVISION.CUSTOMERBOARD.boardplan_id=ENVISION.BOARDPLAN.boardplan_id
LEFT OUTER JOIN ENVISION.CUSTOMER ON ENVISION.CUSTOMER.CUST_ID=ENVISION.CUSTOMERBOARD.CUST_ID
WHERE CAST(ENVISION.CUSTOMER.custnum AS INTEGER) > 0
AND ENVISION.BOARDPLAN.boardplan IS NOT NULL
ORDER BY CAST(ENVISION.CUSTOMER.custnum AS INTEGER)
@tcaddy
tcaddy / check_student_planning.js
Last active March 16, 2018 08:14
A PhantomJS script to monitor Ellucian Student Planning / Self-Service for unresponsiveness. A PowerShell script to run the PhantomJS script and recycle the app pool, send an email.
/*
Student Planning goes down randomly and we have to recycle the app pool to fix it.
This script will try to login to Student Planning and make an AJAX request. It will
return text output (console.log() output) about whether it is working or not.
NOTE: this script relies on PhatomJS, which you can download here:
http://phantomjs.org/download.html
NOTE: change the values of the host, user, and pass variables. Optionally change the timeout variable.
*/
@tcaddy
tcaddy / ellucian-api-tester.html
Last active October 13, 2015 20:44
This will test the Ellucian API. It will retrieve the photo and phone numbers associated with a PERSON ID.
<html>
<head>
<title>Ellucian API Tester</title>
<style>
body {
margin: 10px;
font-family: Calibri,Helvetica,Arial,sans-serif;
font-style:normal;
}
.flexbox-container {
@tcaddy
tcaddy / hpu-sharepoint.css
Last active August 29, 2015 14:27
This is a place to hold some custom javascript and css code for HPU's implementation of the Ellucian Sharepoint Portal
/* Hide all like links on IT pages */
form[action^='/admin-services/it'] [id^='likesElement-'],
form[action^='/administrative-services/information-technology'] [id^='likesElement-'], {
display: none;
}
/* Hide all 'Email a link' links on IT pages */
form[action^='/admin-services/it'] li[id*='share'] a[title='Email a link'],
form[action^='/administrative-services/information-technology'] li[id*='share'] a[title='Email a link'] {
display: none;
}
CoffeeScript
ColdFusion
Cucumber
HTML-CSS-JS Prettify
Javascript Beautify
JSONLint
Package Control
PowerShell
Pretty JSON
RocketUniData
@tcaddy
tcaddy / rename_for_car
Created April 10, 2015 01:52
Rename mp3 files for my Toyota radio to maintain song order. Copy this file to folder of mp3 files for an album and run it.
#!/usr/bin/env ruby
# coding: utf-8
require 'rubygems'
require "mp3info"
dir = File.expand_path(File.dirname(__FILE__))
Dir["#{dir}/*mp3"].each do |filename|
Mp3Info.open(filename) do |mp3|
disk_num = mp3.tag2["disc_number"]
@tcaddy
tcaddy / oracle_rails
Created May 14, 2013 17:10
ENV setup to make oracle db connection work before executing Rails/irb (this is for the ruby-oci8 Rubygem)
#!/bin/sh
export ORACLE_HOME=/usr/lib/oracle/11.1/client
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export PATH=$PATH:$ORACLE_HOME/bin
exec "/usr/bin/ruby" "$@"
@tcaddy
tcaddy / mongrel.rb
Created February 26, 2013 14:00
Use Mongrel as the default Rails server in Rails 3.2.x instead of WEBrick
# config/initializers/mongrel.rb
# This will make Mongrel the default server in development
module Rack
module Handler
def self.default(options = {})
# Guess.
if ENV.include?("PHP_FCGI_CHILDREN")
# We already speak FastCGI
options.delete :File
options.delete :Port