Skip to content

Instantly share code, notes, and snippets.

View stefaneg's full-sized avatar

Guðlaugur Stefán Egilsson stefaneg

View GitHub Profile
@stefaneg
stefaneg / SKILL.md
Last active October 14, 2026 21:03
WTF/minute skill
name clean-assessment
description Estimate code quality as WTFs per minute of human reading. Use when asked for a ballpark quality assessment, WTF score, or assessment of how confusing code is to maintain.

WTF per minute

Estimate how often a competent maintainer would stop reading and think

@stefaneg
stefaneg / app.js
Created October 2, 2013 11:56
AngularJS add class to table header on cell hover. Add this directive to td being rendered in order to get class set on the corresponding td in thead section of the table.
.directive('addClassToHeaderOnHover', function(){
return function(scope, element, attrs){
var classname = element.attr('add-class-to-header-on-hover');
element.mouseenter(function(){
var idx = element.index() + 1;
var $htd = element.parents('table').find('thead td:nth-child(' + idx + ')');
$htd.addClass(classname);
});
element.mouseleave(function(){