Skip to content

Instantly share code, notes, and snippets.

@tcaddy
tcaddy / bootstrap-progress-auto.css
Created May 21, 2012 19:40
Use CSS to auto expand-retract progress bar infinitely
/* this animation is for progress bars that are not active */
.progress.auto-progress > .bar {
-webkit-animation: progress-bar-auto 2s linear infinite;
-moz-animation: progress-bar-auto 2s linear infinite;
-ms-animation: progress-bar-auto 2s linear infinite;
-o-animation: progress-bar-auto 2s linear infinite;
animation: progress-bar-auto 2s linear infinite;
}
/* this animation is for progress bars that are active */
.gecko .gform_body input[type='text'] {
height: inherit;
padding: 5px;
}
@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 / rspec.rake
Last active December 10, 2015 00:08
Place this file in the `lib/tasks` folder of your Rails project. Run `rake -T` to see available rake tasks. This will dynamically create a single rake task for each single `*_spec.rb` file. It will also create additional rake tasks that run all `*_spec.rb` files in a given sub-directory.
require 'rspec/core/rake_task'
orm_setting = Rails.configuration.generators.options[:rails][:orm]
spec_prereq = if(orm_setting == :active_record)
Rails.configuration.active_record[:schema_format] == :sql ? "db:test:clone_structure" : "db:test:prepare"
else
:noop
end
namespace :spec do
[:requests, :models, :controllers, :views, :helpers, :mailers, :lib, :routing].each do |sub|
dn = "#{File.expand_path(::Rails.root.to_s)}/spec/#{sub}"
@tcaddy
tcaddy / config
Last active December 11, 2015 17:29
Desktop notifications and Last.fm scrobbing with Pianobar (CLI Pandora music player). Inspired by https://gist.github.com/3056329
# User
user = YOUR_EMAIL_ADDRESS_FOR_PANDORA_ACCOUNT
password = YOUR_PASSWORD_FOR_PANDORA_ACCOUNT
# Misc
event_command = /YOUR_PATH_TO_HOME_FOLDER/.config/pianobar/pianobar-lastfm.rb
audio_quality = high
rpc_host = tuner.pandora.com
tls_fingerprint = 2D0AFDAFA16F4B5C0A43F3CB1D4752F9535507C0
@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
@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 / 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)
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);
}
}