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
SEP = ", " | |
QUOTE = "\'" | |
NEWLINE = System.getProperty("line.separator") | |
KEYWORDS_LOWERCASE = com.intellij.database.util.DbSqlUtil.areKeywordsLowerCase(PROJECT) | |
def record(column, dataRow) { | |
def value = dataRow.value(column) | |
if( value == null) | |
return |
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
SLACK_CODE = "```" | |
SEP = "|" | |
NEWLINE = System.getProperty("line.separator") | |
def scan(ROWS, COLUMNS) { | |
result = [] | |
result.add(COLUMNS.collect { col -> col.name() }) | |
ROWS.each { row -> result.add(COLUMNS.collect { col -> row.value(col).toString() }) } |
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
FROM debian:jessie | |
MAINTAINER Koan Health <[email protected]> | |
ADD ./run.sh /usr/bin/ | |
CMD ["run.sh"] | |
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
# simple commands to alter the GOPATH for longer than a single command | |
alias guse='GOPATH=$(godep path):$HOME/dev/go' | |
alias greset='GOPATH=$HOME/dev/go' |
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 Command | |
include ActiveModel::Validations | |
include ActiveRecord::Serialization | |
include Virtus | |
include VirtusParameters | |
def initialize(params = {}) | |
super | |
parse_params params | |
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
[ | |
{ "keys": ["super+d"], "command": "duplicate_line" }, | |
{ "keys": ["ctrl+shift+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} }, | |
{ "keys": ["super+shift+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} }, | |
{ "keys": ["super+j"], "command": "join_lines" }, | |
{ "keys": ["ctrl+shift+j"], "command": "join_lines" }, | |
{ "keys": ["super+\\"], "command": "reveal_in_side_bar" }, | |
{ "keys": ["super+alt+l"], "command": "reindent" }, | |
// Select text between brackets | |
{ |
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 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 |
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 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 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 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 |
NewerOlder