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
xAjaxRequest = Class.create({ | |
initialize: function (url, options) { | |
//if the request has a callback, wrap that in our own callback | |
if (typeof options.onComplete == "function") { | |
var f = options.onComplete; | |
options.onComplete = |
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
# Knights Tour - unpolished | |
module KnightsTour | |
class Game | |
def initialize (boardHeight, boardWidth) | |
@board = Array.new(boardHeight) {Array.new(boardWidth, 0)} | |
@moveCounter = 0; | |
end | |
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
(function(){ | |
$("firstName").value = "Joe"; | |
$("lastName").value = "Test"; | |
$("email").value = $("emailConfirm").value = "user" + Math.round(Math.random() * 1000000) + "@example.com"; | |
$("birthMonth").selectedIndex = 1; | |
$("birthDate").selectedIndex = 2; | |
$("birthYear").selectedIndex = 10; | |
$("phone").value = "123456789" | |
$("accName").value = "Tst" + Math.round(Math.random() * 1000000); | |
$("pwd").value = $("pwdConfirm").value = "Tester1234"; |
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
$pages-z-index: 1; | |
$menu-z-index: $pages-z-index - 1; | |
$betcard-mask-z-index: $pages-z-index + 1; | |
$betcard-z-index: $betcard-mask-z-index + 1; | |
$header-z-index: $betcard-z-index + 1; | |
$alert-dialog-z-index: $header-z-index + 1; | |
$betcard-delay-z-index: $alert-dialog-z-index + 1; | |
$ajax-blocker-z-index: $betcard-delay-z-index; |
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
DynResourceLoader = Class.create({ | |
initialize: function () { | |
document.observe("custom:pageAddedToDOM", this.load.bind(this)); | |
}, | |
load: function (e) { | |
var page = e.memo; | |
if (page.hasAttribute("data-required-js")) { |
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
module Minesweeper | |
class Game | |
attr_reader :fields | |
def initialize | |
@fields = [] | |
@allow_input = true |
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
class MyProject < Padrino::Application | |
register Padrino::Rendering | |
register Padrino::Mailer | |
register Padrino::Helpers | |
MY_CONST = 123 | |
end |
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
class Thing | |
MY_CONST = 123 | |
def doStuff (&block) | |
p "doStuff: #{self.class}" # => "doStuff: Thing" | |
p "doStuff: #{MY_CONST}" # => "doStuff: 123" | |
instance_eval &block | |
end |
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
def self.return_code_test | |
return_code = @db.synchronize do |conn| | |
stmnt = conn.prepareCall('{ ? = call dbo.sp_tmp_stu_sequel_test() }') | |
stmnt.registerOutParameter(1, java::sql::Types::INTEGER) | |
stmnt.execute | |
# output parameters have not yet been processed, must call getMoreResults() first. | |
stmnt.getMoreResults | |
stmnt.getInt(1) | |
end |
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
existing_raf_code = ':-(' # no do-while in Ruby | |
until existing_raf_code.nil? | |
new_client_raf_code = SIASquirrel::SIA::RAFReferrer.generateRAFCode | |
existing_raf_code = SIASquirrel::SIA::RAFReferrer[:rafcode => new_client_raf_code] | |
end |
OlderNewer