Skip to content

Instantly share code, notes, and snippets.

@rachidcalazans
rachidcalazans / coc-settings.json
Created November 7, 2020 09:50
coc-settings.json
{
"solargraph.diagnostics": true,
"solargraph.useBundler": false,
"diagnostic.format": "%message [%source]",
"diagnostic.virtualText": true,
"diagnostic.checkCurrentLine": true,
"diagnostic.separateRelatedInformationAsDiagnostics": true,
}
@rachidcalazans
rachidcalazans / .tmux.conf
Last active November 7, 2020 11:36
.tmux.conf
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# set first window to index 1 (not 0) to map more to the keyboard layout...
set-option -g base-index 1
set-window-option -g pane-base-index 1
set-window-option -g mouse on
set-window-option -g mode-keys vi
@rachidcalazans
rachidcalazans / .a-dotfiles
Last active August 19, 2021 10:56
My Dotfiles
My Dotfiles
brew install fzf
brew install xclip
brew install autojump
@rachidcalazans
rachidcalazans / tt.py
Last active May 2, 2019 13:01
test load
def tt_print():
print('Hello Load')
@rachidcalazans
rachidcalazans / sample_05.rb
Created September 29, 2018 03:42
Design Patterns in Ruby - Template Method
class Cappuccino < CaffeineBeverage
def brew_condiments
puts 'brew cappuccino grinds'
end
def add_aditional_condiments
puts 'add sugar'
end
end
@rachidcalazans
rachidcalazans / sample_04.rb
Last active September 29, 2018 03:55
Design Patterns in Ruby - Template Method
class CaffeineBeverage
def prepare_recipe
boil_water
brew_condiments # new method
add_aditional_condiments # new method
pour_in_cup
end
private
@rachidcalazans
rachidcalazans / sample_03.rb
Created September 29, 2018 03:37
Design Patterns in Ruby - Template Method
cappuccino = Cappuccino.new
cappuccino.prepare_recipe
# => boil water
# => brew cappuccino grinds
# => pour in cup
# => add sugar
tea = Tea.new
tea.prepare_recipe
# => boil water
@rachidcalazans
rachidcalazans / sample_02.rb
Created September 29, 2018 03:37
Design Patterns in Ruby - Template Method
class CaffeineBeverage
def prepare_recipe
# Abstract method without implementation
end
def boil_water
puts 'boil water'
end
def pour_in_cup
@rachidcalazans
rachidcalazans / sample_01.rb
Last active September 29, 2018 03:56
Design Patterns in Ruby - Template Method
class Cappuccino
def prepare_recipe
boil_water
brew_cappuccino_grinds
pour_in_cup
add_sugar
end
private
@rachidcalazans
rachidcalazans / sample_04.rb
Created August 15, 2018 11:53
Example I for the Post - Design Patterns in Ruby - Strategy - Part I
receivers = []
subject = 'Some subject'
content = 'Some content'
ios_app_token = 'Ja80-1jd81-AlI71'
ios_strategy = IosStrategy.new(ios_app_token)
ios_notification = Notification.new(ios_strategy, receivers, subject, content)
email_from = '[email protected]'