Currently interested in ReactJS, Node, TypeScript, AI, UX.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
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.
ctrl+k e
explorer (sometimesctrl+shift+e
)ctrl+1
focus on editoralt+up
move line upshift+alt+right
extend selectionf12
go to definitionshift+f12
see usagesctrl+d
select occurrencesctrl+k ctrl+d
skip last selected occurrence and select next (editor.action.moveSelectionToNextFindMatch)ctrl+u
undo select occurrencectrl+alt+-
go back
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{}.as_json # {} | |
{}.to_json # "{}" | |
# query / command | |
user_params # query, no get_params etc, prefer queries over commands, leads to more declarative code, which is simpler | |
remote_document # Query, not get_document, more declarative | |
buy_document! # Exception to the above, it's probably a POST and I want to express that it's not a free call | |
prepare_document! # Bang to express imperative behaviour (?) | |
compact_params(params) # command - takes args and can be reused | |
compacted_user_params # YES, a noun is better |
title | date | author | tags |
---|---|---|---|
The Direction Of The Dependency |
2016-02-26 |
ecoologic@protonmail.ch |
Architecture, Dependency Management, Ruby |
When projects grow they become hard to change. One aspect that is not often highlighted is dependency direction. I haven't found much material on the topic, maybe the best ideas came from this talk by Sandi Metz "Less, the path to a better design".
- 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)
- 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
NewerOlder