Skip to content

Instantly share code, notes, and snippets.

View dariodaich's full-sized avatar
🎮
There are levels to it.

Dario Daić dariodaich

🎮
There are levels to it.
  • ButterflyMX
  • Croatia, Zagreb
View GitHub Profile

by Russ Olsen

  1. Be serious
  • it is a focused/conscious activity, not a byproduct of office behaviour
  1. You need a Plan
  • zoom in/out
  • explain through process and context
  1. Mind the Gap
@dariodaich
dariodaich / simple_git_branch.sh
Created March 4, 2019 14:53
Display Git branch in your prompt.
# !/bin/bash
function simple_git_branch() {
if [ -n "$(ls -la | grep '.git$')" ]; then
echo "$(git branch | grep '^*' | colrm 1 2)"
else
echo "~"
fi
}
@dariodaich
dariodaich / vim_color_scheme_setup.md
Last active February 16, 2019 20:53
Set up and choose `vim` color scheme, quickly.

Pick vim color scheme, quickly

When you are in need of a new color scheme and you want to sidestep the hassle of manually editing and loading each scheme one by one, you can do so with these steps:

  1. copy switch_colors.vim script to ~/.vim/plugin/switch_colors.vim
  2. clone vim-colorschemes
  3. copy schemes from vim-colorschemes/colors to ~/.vim/colors
  4. while in vim execute :SetColors all command (it will set the script to use newly downloaded schemes from the repo)
  5. use F8 to cycle forward and Shift-F8 to cycle backwards through all schemes
  6. after choosing one, set its name in .vimrc color scheme with colorscheme [scheme name]

Foreword

Blamestorming - the ultimate blame game within the working environment.

Professionals set boundary between their work and private time.

Preface

@dariodaich
dariodaich / rails_variants.md
Last active November 30, 2016 08:14
Render different templates using single action.

Action Pack Variants

Basecamp had a problem. How did DHH solve it?

  • the problem : how to serve different view templates to their hybrid mobile apps and desktop clients at the same time?
  • the solution: introduce a new feature to Rails. One that will enable single action to serve different templates.

How is it done?

  • conceptually: "variant" is a symbol whose name constitutes a part
@dariodaich
dariodaich / contributing_to_ruby_documentation.md
Last active February 1, 2018 17:12
Guide on contributing to Ruby documentation.

How to contribute to Ruby docs

The Steps

  1. fork the documenting-ruby/ruby repo
  2. open the GitHub issue regarding docs you want to rewrite/add
  3. make your changes to the documentation
  4. use RDOC to generate local HTML pages for a preview
  5. delete RDOC generated temp directory
  6. commit the changes

defunkt/gist cheat sheet

link: https://github.com/defunkt/gist

Main features

gist (options) my_gist.rb

Description Option Full command
single file upload / filename.format
multiple file upload / file1 file2 file3

✌️im

Native features

Autocomplete

Documented in |ins-completion|.

While in Insert mode:

  • ^x^n - for current file
@dariodaich
dariodaich / ruby_scopes.md
Last active August 23, 2016 22:09
Concise explanations of scopes in Ruby, and a few quizzes.

Scopes in Ruby

What is Scope?

Scope is a program space within which certain types of variables are visible.

Why is Global State evil? Main reasons:

  1. it is hard to track values and assignments of variables throughout the program
  2. since there is only one namespace available, naming variables, which is hard,

The Mythical Man-Month - go-to book summary

The following is the summary of the Mythical Man-Month aka MMM, the book that needs no introduction. It is a must-read for every participant of any software development process.

Insights sections include my personal realizations derived from the material read and are essentially a collection of a-ha moments.