Skip to content

Instantly share code, notes, and snippets.

View nicolasrouanne's full-sized avatar

Nicolas Rouanne nicolasrouanne

  • Software Engineer
  • Marseille, France
View GitHub Profile
@nicolasrouanne
nicolasrouanne / mock_geocoder.rb
Last active March 5, 2018 09:48 — forked from glittershark/mock_geocoder.rb
Mock geocoding in Rspec, with _specifics for `Google Geocoding API`
# In spec_helper:
# RSpec.configure do |config|
# ...
# config.include(MockGeocoder)
# end
#
# In your tests:
# it 'mock geocoding' do
# # You may pass additional params to override defaults
# # (i.e. :coordinates => [10, 20])
{
"included": [
{
"id": "1",
"type": "boat_model",
"attributes": {
"name": "Demacia",
"boat_type": "sailboat",
"loa": 16.63,
"beam": 1.23,
@nicolasrouanne
nicolasrouanne / VSCODE_LAUNCH.md
Last active January 28, 2022 22:43
VS Code configuration: settings & debugger config (Ruby, React)

VS Code launch.json configurations

VS Code launch.json file serves as a debugging configuration file.

Introduction

Where to put it

It must be stored in PROJET_ROOT/.vscode/launch.json.

Should I commit it?

Though opinions vary, it is not recommended to commit such files in source control. It is specific to every developer, and commiting it would prevent each developer to configure it according to his needs.

@nicolasrouanne
nicolasrouanne / blog.md
Last active January 17, 2019 14:20
Deployment on AWS Elastic Beanstalk

Context

AWS Elastic Beanstalk is the Platform As A Service solution by AWS. It is thought as a replacement for Heroku wich is great 🙌 but can become very expensive 💰 when the project is growing or in need of real performance 🏎.

Google App Engine comparison

Google Cloud also has its Platform As A Service product, Google App Engine. However very promising and notably simpler than AWS Elastic Beanstalk, we have been experiencing serious issues while testing it:

  • downtime in deployment 🚧: when deployong a new version of the app, it often becomes unreachable (5xx errors) for up to a whole minute.
  • veeeery long deploys ⬆️ ⏲: it takes on average 8 to 10 minutes ⏳ waiting for a new version of the application to deploy. Compared to a few seconds on Heroku and a few minutes on Elastic Beanstalk. We found out that it truly harmed our development wor
@nicolasrouanne
nicolasrouanne / Git_Pro_cheatsheet.md
Last active November 6, 2019 10:25
Git Pro cheatsheet

Git Pro cheatsheet

Rewriting history

git commit --amend # edit last commit
git commit --amend --no-edit # edit last commit w/o changing commit message

Undoing git stuff

When you make a mistake (e.g. a hard reset to a previous commit, losing important work), you can always undo your changes made with git, even when it seems irrevocaly lost

@nicolasrouanne
nicolasrouanne / .zshrc
Last active April 24, 2024 09:02
zsh configuration file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/nicolasrouanne/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

Workflow

We are using the Github flow, which is mainly:

  • one master branch that is always production ready and in a deployable state 🛰️
  • one branch by feature or bug - a.k.a. feature branch
  • make a Pull Request (PR) on master for your feature / bug fix to be merged and go in production 🚀

No overhead

@nicolasrouanne
nicolasrouanne / NGINX.md
Last active June 19, 2020 13:30
nginx on Mac OS

NGINX

Set up nginx on Mac OS

Installation

Install nginx with Homebrew:

brew install nginx

Start nginx as a brew service: