This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = 9; var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; var randomstring = ''; for (var i=0; i<count; i++) { var rnum = Math.floor(Math.random()*chars.length); randomstring += chars.substring(rnum,rnum+1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var d = new Date(); var da = d.getDate(); da = ( da < 10 ? "0" : "" ) + da; var mo = d.getMonth() + 1; mo = ( mo < 10 ? "0" : "" ) + mo; var yr = d.getFullYear(); mo + "/" + da + "/" + yr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var d = new Date(); var da = d.getDate(); da = ( da < 10 ? "0" : "" ) + da; var mo = d.getMonth() + 1; mo = ( mo < 10 ? "0" : "" ) + mo; var yr = d.getFullYear(); mo + "-" + da + "-" + yr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Upload x paired Marc/EDI order files. Used for scale testing of Staff Upload function. | |
# | |
# Copyright 2005-2013 The Kuali Foundation | |
# | |
# Licensed under the Educational Community License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'nokogiri' | |
base_url = 'http://tst.docstore.ole.kuali.org/sru?version=1.2&operation=searchRetrieve&query=' | |
query_str = 'title%3Dtest' | |
full_url = base_url + query_str | |
# Pull search query results into Nokogiri XML document. | |
noko = Nokogiri::XML(open(full_url)) | |
record_count = noko.xpath("//*[local-name()='record' and namespace-uri()='http://www.loc.gov/MARC21/slim']").count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'nokogiri' | |
base_url = 'http://tst.docstore.ole.kuali.org/sru?version=1.2&operation=searchRetrieve&query=' | |
query_str = 'title%3Dtest' | |
full_url = base_url + query_str | |
puts "Searching on #{query_str}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
# Average the values in an array. | |
def avg vals = [] | |
vals.inject(:+)/vals.count | |
end | |
# Test a Watir-Webdriver expression to ensure it's the fastest way to address an element. | |
# | |
# Example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery("img").map( | |
function() { | |
return this.naturalWidth > 0 && this.naturalWidth !== "undefined" && this.complete; | |
}).get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var opacityCheck = function(selector) { | |
return window.getComputedStyle(document.querySelectorAll(selector)[0])["opacity"] === "1"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return document.readyState === 'complete'; |
OlderNewer