

Ask HN: Does this exist? (micro open-source) - computerslol

I just wrote a pair of extension methods in C# to get or set a series of bits from a ulong.<p>This must have been done thousands of times by other devs. I have done it a few times myself. I know I have it somewhere in another project, but I don&#x27;t feel like hunting to find it. It&#x27;s not an amazing feature, just a small thing I need.<p>It really doesn&#x27;t have a place in a library, it&#x27;s a small stop-gap; like thousands of other small stop-gaps we all write into our projects.<p>I don&#x27;t know whether or not the technique I used is the fastest possible; at the moment I don&#x27;t really care. I needed something quick, and I wrote it. It will probably never get replaced, as it will never show up on a hot-path when profiling.<p>I&#x27;d like to know if there is a place I can put little things like this, with a way to find little things like this placed there by others.<p>I&#x27;d imagine you&#x27;d need to come up with a way of describing your method in a verbose way so it can be found.<p>If I use one of these small methods from that place, and that method is improved by someone else, I&#x27;d like to be automatically notified that there is a better solution so I can go back and replace mine.<p>Does something like this exist? If not, who wants to build it (I&#x27;m busy)?<p>Hey there stackoverflow. This might be right up your alley.
======
jevinskie
It seems that the Perl community isn't afraid of tiny, single-purpose modules.
Take File::Which for instance. [0] It has just to functions used to find
executables in your path. I like the idea of using a library. While the logic
itself is pretty simple, there are some corner-cases that come up between
various OSes. I'll save myself the hassle and use the library instead of
writing it myself. Plus, once it is in a library you can get rid of the 5
copies throughout your various projects.

[0]: [http://search.cpan.org/~adamk/File-
Which-1.09/lib/File/Which...](http://search.cpan.org/~adamk/File-
Which-1.09/lib/File/Which.pm)

------
stollcri
I'm not a C# dev, but can't you just use simple bit masking?

You can share small chunks of code like this here:
[https://gist.github.com](https://gist.github.com)

~~~
computerslol
Yeah; I am using simple bit-masking.

Are gists indexed in a big indexed list where others that don't know me can
find them using search terms?

~~~
tuxracer
[https://gist.github.com/search](https://gist.github.com/search)

------
arikrak
StackOverflow does that with some surrounding text. The search part of that
would be hard though.

------
fredthefrog
[https://gist.github.com/](https://gist.github.com/)

------
krapp
github gist... or pastebin?

