Skip to content

Instantly share code, notes, and snippets.

View twist900's full-sized avatar
⌨️
*.{ex,rb,js,sh,py,cs ... }

Georgy Shabunin twist900

⌨️
*.{ex,rb,js,sh,py,cs ... }
View GitHub Profile
@twist900
twist900 / comment_regex.txt
Created October 12, 2016 11:11
match ruby comments (useful for removal of such)
^#.*\n
@twist900
twist900 / SOLID.markdown
Created September 20, 2016 08:08 — forked from emaraschio/SOLID.markdown
SOLID Principles with ruby examples

#SOLID Principles with ruby examples

##SRP - Single responsibility principle A class should have only a single responsibility.

Every class should have a single responsibility, and that responsibility should be entirely encapsulated. All its services should be narrowly aligned with that responsibility, this embrace the high cohesion.

##OCP - Open/closed principle Software entities should be open for extension, but closed for modification.

@twist900
twist900 / simple_redux.js
Last active August 22, 2016 07:12
A simplest redux example
#Reducer
const counter = (state = 0, action)=> {
switch(action.type){
case "INCREMENT":
return state + 1;
case "DECREMENT":
return state - 1;
default:
return state;
}