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 "pry" | |
| require "csv" | |
| class GenerateCsvSummary | |
| NUMBER_OF_ROWS = 10 | |
| GENERATED_FILE_PATH = "./csv_summary.csv" | |
| def initialize(absolute_directory_path) | |
| @absolute_directory_path = absolute_directory_path | |
| 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
| class A{ | |
| saveArea(callback){ | |
| const {t} = this.props; | |
| new Api('/nurses/area').post(this.prepareData()) | |
| .then(response => { | |
| if(response.status === 200){ | |
| response.json().then(json => { | |
| this.setState({ | |
| popupTitle: t('area.success.title'), |
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 'pry' | |
| # TASK: Implement this class to make tests pass | |
| class BaseClass | |
| attr_reader :errors | |
| VALIDATORS = %i[presence_of_validator numericality_validator].freeze | |
| def self.validates_presence_of(name) | |
| @presence_of_attr = name | |
| 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
| THREADS_NUM.times.map { | |
| Thread.new do | |
| while !@objects.empty? | |
| object = @objects.pop | |
| @mutex.synchronize do | |
| print "#{Time.now.strftime("%H:%M")} - Saving data: #{@objects.length} items left. " | |
| print "\r" | |
| end | |
| if object.save |
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
| # add key to authorized keys: | |
| 1. create file `.ssh/authorized_keys` on server, then on local machine: | |
| `cat ~/.ssh/id_rsa.pub | ssh piotr@xxx.xxx.xxx.xx -p 5555 'cat >> .ssh/authorized_keys'` | |
| 2. Check if it possible to login without password | |
| # base capistrano config |
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
| [user] | |
| name = Piotr | |
| email = galaspiotrek@gmail.com | |
| [push] | |
| default = current | |
| [color] | |
| ui = auto | |
| branch = auto | |
| diff = auto | |
| interactive = auto |
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
| class Validator | |
| def self.presence(value, *fields) | |
| puts value | |
| puts fields | |
| end | |
| end | |
| class Product | |
| def self.validates(*params) |
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 Filters | |
| class Arrays | |
| initialize(filterad_array, pattern) | |
| @filteredArray = filteredArray | |
| @pattern = pattern | |
| end | |
| def fromPrimeCount | |
| if validateInputs? | |
| filtered |
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
| upstream action { | |
| server unix:/srv/www/development/action-cable/tmp/sockets/puma.sock fail_timeout=0; | |
| } | |
| server { | |
| server_name .actioncable.kulisz.eu; | |
| keepalive_timeout 5; | |
| root /srv/www/development/action-cable/public; | |
| client_max_body_size 4G; | |
| location / { | |
| try_files $uri @action; |
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
Show hidden characters
| { | |
| "Seti_sidebar_font_size_14": true, | |
| "Seti_tab_font_12": true, | |
| "caret_extra_bottom": 3, | |
| "caret_extra_top": 3, | |
| "caret_extra_width": 2, | |
| "color_scheme": "Packages/User/SublimeLinter/Oceanic Next (SL).tmTheme", | |
| "file_exclude_patterns": | |
| [ | |
| "npm-debug.log" |
NewerOlder