Skip to content

Instantly share code, notes, and snippets.

View PatrickKennedy's full-sized avatar

Patrick Kennedy PatrickKennedy

View GitHub Profile
@rvillars
rvillars / README.md
Last active March 22, 2016 12:31
Preprocess directive attributes in AngularJS

Preprocess directive attributes in AngularJS

Sometimes you need to modify a two way binded attribute value prior to use it in the directive. This can't be done in the directive controller, because the attribute assignment is done after the controller is executed.

The link function is able to access the attributes directly but unfortunately a two way binded attribute expression isn't yet evaluated a that time.

The solution is to process the attribute in a scope.$watch function where the value will be evaluated automatically.

http://jsfiddle.net/gh/gist/angularjs/1.2.1/d60d9416f2206c6e3407/

@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active March 30, 2026 00:55
Conventional Commits Cheatsheet
@jake-stewart
jake-stewart / color256.md
Last active March 30, 2026 00:56
Terminals should generate the 256-color palette

Terminals should generate the 256-color palette from the user's base16 theme.

If you've spent much time in the terminal, you've probably set a custom base16 theme. They work well. You define a handful of colors in one place and all your programs use them.

The drawback is that 16 colors is limiting. Complex and color-heavy programs struggle with such a small palette.