Skip to content

Instantly share code, notes, and snippets.

View dgowrie's full-sized avatar
🤘

David Gowrie dgowrie

🤘
View GitHub Profile
@dgowrie
dgowrie / array-methods-functional.js
Last active September 14, 2019 07:01
Map, Reduce, Filter, chained usage - web dev interview, discussion
const animals = ['cat', 'dog', 'fish'];
const lengths = animals.map(animal => animal.length);
console.log(lengths);
const reducer = (acc, word) => acc + word.length;
const letterCount = animals.reduce(reducer, 0);
console.log(letterCount);
const hasThree = word => word.length === 3;
@dgowrie
dgowrie / type-the-time
Created January 23, 2020 23:43
Timestamp just the time - Automator quick action applescript
on run {input, parameters}
set theTime to (time string of (current date)) as string
tell application "System Events"
keystroke theTime
end tell
return input
end run
@dgowrie
dgowrie / git-fuzzy-find-branch.sh
Created April 3, 2020 15:23
git fuzzy find branch
fbr () {
local branches branch
branches=$(git branch --all --sort=-committerdate | grep -v HEAD) && branch=$(echo "$branches" |
fzf-tmux -d $(( 2 + $(wc -l <<< "$branches") )) +m) && git checkout $(echo "$branch" | sed "s/.* //" | sed "s#remotes/[^/]*/##")
}
@dgowrie
dgowrie / keybindings.json
Created December 2, 2020 22:11
VS Code user key bindings
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+cmd+g",
"command": "editor.action.selectHighlights",
"when": "editorFocus"
},
{
"key": "shift+cmd+l",
"command": "-editor.action.selectHighlights",
@dgowrie
dgowrie / clean_code.md
Created July 19, 2021 21:16 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@dgowrie
dgowrie / pull-request-code-review-tips.md
Last active May 8, 2026 18:33
Pull Request code review tips