Skip to content

Instantly share code, notes, and snippets.

View theozaurus's full-sized avatar

Theo Cushion theozaurus

  • Ignition Works
  • UK
View GitHub Profile
#!/usr/bin/env ruby
#
# Shotgun approach (read: slow and dirty hack) to help find unused helpers in a Rails application
#
puts "Loading all source files into memory :("
source = {}
Dir["app/**/**/*.*"].each do |f|
source[ f ] = File.readlines( f )
var nameserver = /^((([a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?\.)+[a-z]{2,6})|(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))$/i;
$('#configure_domains_form').submit(function() {
return $('input[name^="domainns"]').each(function(){
if(nameserver.test($(this).val())){
// Do nothing
}
else{
if ($(this).val() == ""){
if($(this).attr("name") == "domainns3" || $(this).attr("name") == "domainns4"){
// Do nothing, it's ok for these to be Blank
%%%------------------------------------------------------------------------
%%% File : mod_warm_bindings.erl
%%% Author : Theo Cushion <theo@jivatechnology.com>
%%% Purpose : Enables the creation of authenticated BOSH sessions via HTTP
%%% Created : 29/01/2010
%%%------------------------------------------------------------------------
-module(mod_warm_bindings).
-author('theo@jivatechnology.com').