Skip to content

Instantly share code, notes, and snippets.

View ecoologic's full-sized avatar

Erik ecoologic

View GitHub Profile

VS Code

VS Code Shortcuts

  • ^ is crtl .

Basic editing

  • ⌥↓ / ⌥↑ Move line down/up
  • ⇧⌘\ Jump to matching bracket
@ecoologic
ecoologic / meditation.md
Last active October 2, 2022 00:20
Meditation Checklist

Meditation

It's practically an all-purpose training of the mind.

Meditation has the objects of stable attention and mindfulness (sati in pali), the latter being the optimal interaction between attention and peripheral awareness.

The practice consists in listening to the meditation object (the breath). Whenever you realise the mind wondered off, you happily move back to the meditation object. That's it, everything else are techniques to remove the time you're not following the meditation object.

Advantages Explained

@ecoologic
ecoologic / vsc.md
Last active January 5, 2021 04:31
Visual Studio Code Shortcuts
  • ctrl+k e explorer (sometimes ctrl+shift+e)
  • ctrl+1 focus on editor
  • alt+up move line up
  • shift+alt+right extend selection
  • f12 go to definition
  • shift+f12 see usages
  • ctrl+d select occurrences
  • ctrl+k ctrl+d skip last selected occurrence and select next (editor.action.moveSelectionToNextFindMatch)
  • ctrl+u undo select occurrence
  • ctrl+alt+- go back
@ecoologic
ecoologic / suggestions_to_a_beginner_developer.md
Last active July 25, 2019 06:06
Suggestions to a beginner developer

Suggestions to a beginner developer

  • Be very very humble
  • Pick up small and tedious jobs (bug fixes?)
  • Understand the product and the user
  • Read and fully understand the task
  • Think of the best UX, don't compromise
  • Think of possible bugs in your code
  • Read the stack trace carefully
  • Ask for pairings when stuck

Design Patterns

  • Value: (read-only) does some math or manipulation with one input value, like a model, but for one value only
  • Presenter: (read-only) takes complex data, like different models, and provides extra presentation values, even HTML
  • Service: (mainly-write) Has a main method that writes data through delegation, and can expose the results as read-methods (eg: errors)
  • Query: (read-only) Joins different models and performs SQL queries on them, ideally through SQL views
  • Gateway: (read-write) LIB Wrap of an API (lib: favour primitives, don't depend on app)
  • Serializer: (read-only) Converts input to a string like JSON, CSV, PDF blob etc (prefer others)
  • Parser: (read-only) convert data from one format to another (prefer others)
  • Decorator: (read-only) extends an object with extra value otherwise written in a presenter (prefer others)
@ecoologic
ecoologic / Agile.md
Last active February 7, 2019 01:31

Agile Manifesto points

  • People over tools
  • Sw over doc
  • Collaboration over contract
  • Change over plan

Scrumban

  • Be restful
  • Put view partials in proper resource (table partial, not table body)
  • Namespace a lot, use lib a lot, but don't put app (eg AR models) stuff in lib
  • Models should not use change itself in callbacks; Use services, strategies, queries, have a clear dependency hirarchy
  • Limit the use of validation (defaults?), they are only for UI purposes, (almost) always add relative DB constraints
  • DB foreign_keys, unique indexes, null with defaults
  • No SQL outside of the model
  • Write extra models (or Query objects?) to connect models
  • Write non-AR models
@ecoologic
ecoologic / .bash_aliases
Last active July 12, 2023 01:56
Bash aliases
# Read File System
# alias ag='ag -C' # -C 5 # Context
alias aglog='ag "\>\>\>"'
alias agdeb='ag binding\.pry app/ lib/ vendor/ config/ spec/ && ag debugger app/javascript/ app/assets/javascripts/'
alias agig="ag --ignore-dir={vendor,vendir,node_modules,cache,tmp,test}"
# alias agit='ag --ignore="*_test\.*"'
alias agl='ag -l' # file only
alias agq='ag -Q' # no regex
alias agw='ag --width=300'
alias bigfiles="find . -type f -printf '%s %p\n' | sort -nr | head -30"

Shortcuts

Terminator

Next Window: ctrl+pgDown Reset terminal: ctrl+shift+g

RubyMine (default keymap - rsome emapping)

  • Copy file location ctrl+shift+c
@ecoologic
ecoologic / Ecoologic.md
Last active March 3, 2023 04:25
Ecoologic

Erik T. Ecoologic

Currently interested in ReactJS, Node, TypeScript, AI, UX.

profile for ecoologic on Stack Exchange, a network of free, community-driven Q&A sites

My LinkedIn profile

Profiles