This file contains hidden or 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
| app = (function () { | |
| var Namespace = function () { | |
| } | |
| var Module = function () { | |
| } | |
| Namespace.prototype.createModule = function () { | |
| var m = new Module; | |
| if(arguments.length > 0) |
This file contains hidden or 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
| mything = (function(){ | |
| var Foo, Bar, binky, boo; | |
| binky = function() { | |
| // does something useful | |
| }; | |
| boo = function() { | |
| // does something amazing | |
| }; |
This file contains hidden or 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
| company = app.namespace(company); | |
| company.master= app.namespace(company.master) |
This file contains hidden or 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
| company.master.users = company.master.createModule( function(){ | |
| var RevealedClass, hiddenFunction | |
| RevealedClass = function(){ | |
| // stuff | |
| }; | |
| hiddenFunction = function(){}; | |
| // this is the private area of the module | |
| this.privateThing = 42; |
This file contains hidden or 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
| company.master.users = company.master.users.extend(function(){ | |
| // use it | |
| var myLocalThing = this.privateThing, | |
| ExposedClass = function(){ | |
| }; | |
| return { | |
| Exposed:ExposedClass | |
| } | |
| }); |
This file contains hidden or 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
| company.master.users = company.master.users.extend(function($, log){ | |
| }, $, loggingSystem); |
This file contains hidden or 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 | |
| wb = Spreadsheet.open('sample.xls') | |
| puts "Opened Spreadsheet, #{wb.sheet_count} sheets encountered" | |
| (0..wb.sheet_count-1).each do |sheet_number| | |
| ws = wb.worksheet(sheet_number) | |
| puts "\tWorksheet #{ws.name} has #{ws.row_count} rows and #{ws.column_count} columns}; and Dimensions: #{ws.dimensions}" | |
| end |
This file contains hidden or 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 "capybara" | |
| html = DATA.read | |
| app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
| sess = Capybara::Session.new(:selenium, app) | |
| sess.visit("/") | |
| puts 'You Lose' unless sess.has_content? 'Here it Is' |
This file contains hidden or 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 execute(task) | |
| activity_type = task.activity_type | |
| begin | |
| context = ActivityExecutionContext.new(@service, @domain, task) | |
| activity_implementation = @activity_definition_map[activity_type] | |
| raise "This activity worker was told to work on activity type #{activity_type.name}, but this activity worker only knows how to work on #{@activity_definition_map.keys.map(&:name).join ' '}" unless activity_implementation | |
| output = activity_implementation.execute(task.input, context) | |
| @logger.debug "Responding on task_token #{task.task_token} for task #{task}" | |
| rescue ActivityFailureException => e | |
| respond_activity_task_failed_with_retry(task.task_token, e.message, e.details) |
This file contains hidden or 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 AssignCaseCommand < Command | |
| attribute :case, Case | |
| attribute :owner, User | |
| attribute :created_by, User | |
| attribute :comments, String | |
| attribute :distribute_at, DateTime | |
| attribute :distribute_rule_name, String | |
| attribute :require_initial, Boolean |
OlderNewer