Skip to content

Instantly share code, notes, and snippets.

View IvanDerlich's full-sized avatar

Ivan Derlich IvanDerlich

View GitHub Profile
@IvanDerlich
IvanDerlich / API_experiments.sh
Last active March 30, 2021 01:13
API experimentation example
if [ "$1" == '' ]; then
echo "Please enter option";
exit 1:
fi
echo 'option chosen: ' $1;
baseURL='http://jsonplaceholder.typicode.com/'
resource='posts'
URL=$baseURL$resource
@IvanDerlich
IvanDerlich / gist:a5a3973ec446cdac3cbef40520bf677c
Created March 27, 2021 22:28
Initializing Rails API command
$ rails new court-reservation --api -T --no-sprockets -d postgresql
--api -> No views and other config related with the default way of creating apps.
-T -> No test. This is useful for using Rspec.
--no-sprockets -> Something related with the asset pipeline of Rails.
-d postgresql -> Use postgresql database
https://react-redux.js.org/api/connect
https://blog.logrocket.com/react-redux-connect-when-and-how-to-use-it-f2a1edab2013/
https://reactgo.com/react-redux-connect/
https://dev.to/bhatvikrant/how-to-setup-redux-with-react-2020-cdj
https://medium.com/swlh/accessing-redux-from-components-in-react-react-native-d9f0e4cdb2dc
https://chriscourses.com/blog/redux
https://medium.com/swlh/accessing-redux-from-components-in-react-react-native-d9f0e4cdb2dc
@IvanDerlich
IvanDerlich / RSPEC_ARTICLE_simple-test.rb
Last active June 8, 2020 04:03
ATTENTION: Gist for Rspec Article. Published in medium first.
def sum x , y
x + y
end
describe "sum" do
it "5 + 9 = 14" do
expect(
sum(5,9)
).to be(14)
@IvanDerlich
IvanDerlich / RSPEC_ARTICLE_calculator_spec.rb
Last active June 8, 2020 04:02
Gist created for Rspec Article. Published first in medium.
require('./calculator.rb')
context "Calculator" do
let(:calc){Calculator.new()}
describe "Addition" do
it "5 + 4 = 9" do
expect(
@IvanDerlich
IvanDerlich / RSPEC_ARTICLE_calculator.rb
Last active May 21, 2020 04:45
Gist created for Rspec Article. Published first in medium.
class Calculator
def addition a,b
a + b
end
def substraction a,b
a - b
end