Skip to content

Instantly share code, notes, and snippets.

[user]
email = [email protected]
[color]
ui = true
[alias]
co = checkout
ci = commit
lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
[core]
editor = subl -n -w
@jonnyjava
jonnyjava / CleanCode.md
Last active August 3, 2022 12:28
Clean Code summarized

Clean Code

The boy scout rule

Leave the campground cleaner than you found it

Naming

  • If a name requires a comment, then the name doesn't reveal its intent
  • Use searchable, meaningful and pronounceable names
  • Avoid mental mapping
@jonnyjava
jonnyjava / bashrc
Created October 14, 2015 15:41
git show branch and state in prompt
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ '
@jonnyjava
jonnyjava / poodr.md
Last active November 27, 2022 17:27
Practical Object-Oriented Design in Ruby

Practical Object-Oriented Design in Ruby

1 Introduction

  • OO is about managing dependencies. Objects interact between them exchanging messages
  • Code must follow S.O.L.I.D. principles
    • Single responsibility
    • Open/Closed
    • Liskow substitution
  • Interface segregation
@jonnyjava
jonnyjava / Tpp.md
Last active April 14, 2023 15:00
The Pragmatic Programmer: From Journeyman to Master

The Pragmatic Programmer: From Journeyman to Master

Tips collected

  1. Care About Your Craft
  • Why spend your life developing software unless you care about doing it well?
  1. Think! About Your Work
  • Turn off the autopilot and take control. Constantly critique and appraise your work.
  1. Provide Options, Don't Make Lame Excuses
  • Instead of excuses, provide options. Don't say it can't be done; explain what can be done.
@jonnyjava
jonnyjava / bash_aliases.txt
Last active May 20, 2019 08:56
Everyday aliases
alias 1pass='wine ~/.wine/drive_c/Program\ Files\ \(x86\)/1Password\ 4/1Password.exe'
alias apalogs='cd && tail -f /var/log/apache2/error.log'
alias checkstyle='rubocop -a -f fuubar ; scss-lint'
alias gl='git lg'
alias openmysql='mysql --defaults-file=~/.local_db_conf'
alias quality_test='checkstyle ; rake traceroute ; rubycritic'
alias testall='bin/rspec'
alias update_me_motherfucker='git checkout master && git pull origin master && bundle install && rake db:migrate'
-----------------------------
@jonnyjava
jonnyjava / Refactoring.md
Created May 11, 2017 15:12
Refactoring - Ruby edition

Refactoring

Preface

What is refactoring?

Refactoring is the process of changing a software system in such a way that it not alter the external behaviour of the code yet improves its internal structure It's a process of clean up to minimize the chances to introduces bugs. Refactoring means improve the code design

Chapter 1 - A first example

  • Start writing a good test coverage
  • First refactor, then add new features
@jonnyjava
jonnyjava / roadmap.md
Last active September 27, 2019 09:58
Become a good programmer roadmap
@jonnyjava
jonnyjava / LeanStartup.md
Created July 6, 2017 16:21
What i learnt about Lean Startup

LEAN STARTUP

Books

  • Business Model Generation and Value Proposition Design: - Alexander Osterwalder
  • The Lean Startup: - Eric Ries
  • The Startup Owner's Manual: The Step-By-Step Guide for Building a Great Company - Steve Blank / Bob Dorf
  • The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers - Ben Horowitz
  • The Four Steps to the Epiphany Hardcover – Steve Blank (Author)
  • The Lean Product Playbook: How to Innovate with Minimum Viable Products and Rapid Customer Feedback - Dan Olsen (Autor)