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
| # Retry payment conditions: | |
| # - feature flag is enabled | |
| # - only credit card and bank payments | |
| # - there is no other payment processing for that customer | |
| module Payments | |
| class Retry | |
| def call(payment:) | |
| return unless retry_payment?(payment) | |
| payment.retry! # or @retry_service.call(payment: payment), etc |
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
| desc 'Rake task description' | |
| task :name_of_task do | |
| # Your code goes here | |
| end | |
| #> rake name_of_task |
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 'twitter' | |
| class TwitterClient | |
| def self.client | |
| Twitter::REST::Client.new do |config| | |
| config.consumer_key = "" | |
| config.consumer_secret = "" | |
| config.access_token = "" | |
| config.access_token_secret = "" | |
| 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
| string = "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program" | |
| output = string.split.map do |word| | |
| if word.length > 3 | |
| word[1..-2] = word[1..-2].chars.shuffle.join | |
| end | |
| word | |
| end.join(" ") | |
| puts output # Msot good paegrrmorms do pnimgormarg not bseuace they epcxet to get piad or get aaudliotn by the pbcilu, but buseace it is fun to praogrm |
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
| live_loop :beat do | |
| index = tick | |
| 4.times do | |
| sample :bd_klub, cutoff: 120 | |
| sleep 0.5 | |
| end | |
| sample :drum_cymbal_soft if (index % 2).zero? | |
| end | |
| with_fx :distortion do |
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
| { | |
| "bold_folder_labels": true, | |
| "draw_white_space": "all", | |
| "ensure_newline_at_eof_on_save": true, | |
| "highlight_line": true, | |
| "highlight_modified_tabs": true, | |
| "ignored_packages": | |
| [ | |
| "Vintage" | |
| ], |