Skip to content

Instantly share code, notes, and snippets.

View ecoologic's full-sized avatar

Erik ecoologic

View GitHub Profile
@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 August 11, 2025 01:12
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

{
"added_words":
[
"App",
"refactored",
"refactor",
"api",
"ui",
"async",
"linter",
@ecoologic
ecoologic / debugging.rb
Last active February 27, 2018 05:54
Ecoologic's debugging and console tricks (for Brisbane Ruby Meetup talk)
# CGI.parse(params) # "checklist_list_ids%5B%5D=10806"
# Gem::Specification.map(&:name).sort
# app.users_path # => "/users"
::U = User # Etc
def self.helpme
puts <<-TEXT
v # view helpers (eg: content_tag)
exceptions # List of all exceptions
## NODE-REINSTALL
#!/bin/bash
# node-reinstall
# credit: http://stackoverflow.com/a/11178106/2083544
## program version
VERSION="0.0.17"
@ecoologic
ecoologic / git_branch.sh
Created October 29, 2015 22:16
Smart Git branches (ordered by last update)
git for-each-ref --sort=-committerdate --format='%(committerdate:short)|%(refname)|%(authorname)' refs/heads refs/remotes | head -n20 | awk -F '|' '{ printf "%s %-70s %s\n", $1, $2, $3 }'
@ecoologic
ecoologic / choose_dependency_direction_wisely.md
Last active February 19, 2020 12:13
Blog post on OO dependency direction
title date author tags
The Direction Of The Dependency
2016-02-26
Architecture, Dependency Management, Ruby

The Direction Of The Dependency

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".