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
| # Returns the stack of RScript files | |
| rscript.stack <- function() { | |
| Filter(Negate(is.null), lapply(sys.frames(), function(x) x$ofile)) | |
| } | |
| # Returns the current RScript file path | |
| rscript.current <- function() { | |
| stack <- rscript.stack() | |
| as.character(stack[length(stack)]) |
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 "spx_utils/resque" | |
| describe SpxUtils::Resque do | |
| describe ".job_handler" do | |
| subject do | |
| SpxUtils::Resque.job_handler(:my_queue) do |x, y| | |
| x + y | |
| end | |
| 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
| # git will show dirty branches | |
| GIT_PS1_SHOWDIRTYSTATE=true | |
| # Directory shortening for prompt | |
| # Edit this based on the directory structures you like to use | |
| function shorten_dir() { | |
| d=$(pwd) | |
| d=${d/\/Users\/sim\/dev\/spx/SPX} | |
| d=${d/\/Users\/sim\/dev\/rails_projects/RP} | |
| d=${d/\/Users\/sim\/dev\/proj/PROJ} |
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
| module Amazon | |
| module Authentication | |
| SIGNATURE_VERSION = "2" | |
| @@digest = OpenSSL::Digest::Digest.new("sha256") | |
| def sign(auth_string) | |
| Base64.encode64(OpenSSL::HMAC.digest(digester, aws_secret_access_key, auth_string)).strip | |
| end | |
| def digester |
NewerOlder