ruby test/functional/person_controller.rb
ruby test/functional/person_controller.rb -n test_that_will_run
ruby test/functional/person_controller.rb -n /that_one_end_point_name/
| class Array | |
| # find_insert_index -> returns the index that the value should be inserted into | |
| # to keep the array sorted | |
| # Arguments | |
| # val -> any sort of value that supports comparison or... | |
| # &block -> If you want to compare a specific field on your object you could: | |
| # {|x,y| x.FIELD <=> y.FIELD } | |
| # or you could sort reverse: | |
| # {|x,y| y <=> x} NOTE: your review must be sorted desc. for this to work. |
| // Per the BNR iOS programming guide's chapter on creating BNRItem | |
| import Cocoa | |
| import Foundation | |
| extension Character { | |
| func unicodeIntValue() -> UInt32 | |
| { | |
| let str = String(self) | |
| return str.unicodeScalars[str.unicodeScalars.startIndex].value | |
| } |
Automtically configure tab name in Terminal.app when ssh-ing to a server. You can use any shell commands you want to get the desired output.
I work on external servers 8 hours a day M-F and more likely than not I have multiple ssh sessions at the same time to the same sever under different users. It became a bit of a pain to have to rename the tabs everytime I logged on to a server. I just wanted that to happen auto-magically.
I searched the interwebs and came across this CNet article which had about 99% of what I was looking for. However, it never really mentioned how to modify the script to insert your own formatting. It didn't even mention adding it to your $PATH! So after a few minutes of messing with it I got something quite reasonable. I thought I'd share the results.
| # Official docs are a _bit_ light on specifcs | |
| # http://ruby-doc.org/core-2.0.0/Kernel.html#method-i-set_trace_func | |
| # | |
| # There are other options if you are interested in a general trace: | |
| # * ruby -r tracer your_script.rb | |
| # * https://ruby-doc.org/core-2.3.0/TracePoint.html | |
| # | |
| # What I'd like to be able to do is create a helper module / class that can be added to any class like so: | |
| # |
| # Run and fail | |
| # AWS_ACCESS_KEY_ID=*** ruby connection_pool_issue.rb | |
| # | |
| # Does not crash | |
| # empty_connection_pools_after_fork=true ruby connection_pool_issue.rb | |
| # | |
| # Hypothesis: | |
| # | |
| # the Aws SDK maintains a ConnectionPool in Seahorse. After fork | |
| # file descriptors are shared between the parent process and any child processes. |
| --- | |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: 'Backup DynamoDB table to S3, convert export to Parquet, and add table to Athena' | |
| Parameters: | |
| TableName: | |
| Description: DynamoDB table name | |
| Type: String | |
| BackupMaximumConsumedReadThroughput: | |
| Description: Percentage of table read throughput a backup can use. Expressed between 0.01 and 1.0. Defaults to 20% of available read throughput | |
| Type: Number |
| --- | |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: 'Common resources for DynamoDB backups' | |
| Resources: | |
| DynamoDBBackupsBucket: | |
| Type: "AWS::S3::Bucket" | |
| Properties: | |
| BucketName: | |
| Fn::Join: | |
| - "-" |