Better HN
topnewbestaskshowjobs
Log inSign up

mattsah

57 karma · joined Jan 12, 2013 (13y ago) · 35 submissions

Submissions

1.

Jsonified Ini Notation(github.com ↗)

2 points · by mattsah · 11y ago · discuss

comment 11y ago · link · parent

Note, this uses some newer CSS and JS stuff, Only tested in Firefox 35, but should probably have a good chance on Chrome too.

Hit ctrl+s to save.

3.

Patturns: A Silly Little Pattern Workspace(mattsah.github.io ↗)

2 points · by mattsah · 11y ago · 1 comment

comment 12y ago · link · parent

How's the Linux support?

comment 13y ago · link · parent

Closest I can find is commits by author, but doesn't parse out specific files unless you view the commits:

https://github.com/mattsah/beer-recipes/commits/master?autho...

Change "mattsah" in the URL above to your github handle

comment 13y ago · link · parent

It'd likely be possible to come up with that information using git, but I don't think github has an interface for it. If it makes you feel better I'll probably be starting a site with the repository at some point which would reflect that, i.e. allow you to search for recipes with commits by a certain author via parsing git blame output.

Right now I just want to build the repo.

7.

Homebrew Beer Recipes(github.com ↗)

4 points · by mattsah · 13y ago · 3 comments

8.

GNOME 3 Rocks(scriptogr.am ↗)

3 points · by mattsah · 13y ago · discuss

comment 13y ago · link · parent

Did you use Chrome to access the URL?

10.

InKWell 2.0 PHP Framework is now soft Beta(inkwell.dotink.org ↗)

1 points · by mattsah · 13y ago · discuss

comment 13y ago · link · parent

I couldn't get the article to load, but given that it's Bill Gates, I assume this has something to do with the spread of HIV/AIDS.

From the commments I can discern that one concern is reducing pleasure. I'd imagine the condoms used in third-world country are not high-end super thin condoms which make the experience a bit better, but the really rubbery thick ones you can get for free at a high school sex class.

That said, is this really about building a better condom? Or just building a better condom, cheaper?

Also, I'm not sure this is the primary problem. You'd probably be better of spending $100,000 on fighting the catholic church to make sure condoms, even the cheap kind, are widely available.

comment 13y ago · link · parent

No one has a "right" not to be offended insofar as such would trump any right to freedom of speech. That said, any company under the current circumstances has a "right" to fire an employee who might afford them negative attention one way or the other, and certainly under the conditions of sexual harassment.

Please note, I am not saying that I agree the company should have done so, merely that they likely have the right.

comment 13y ago · link · parent

Unlike Ruby devs we don't need to pray to God every time we deploy our code?

14.

Hookline: a simple wrapper and manager for lsyncd instances(github.com ↗)

1 points · by mattsah · 13y ago · discuss

comment 13y ago · link · parent

Bigger inconvenience in Firefox 19:

Script: http://gistflow.com/assets/application-ffa7d5c2098bdbb3028af...

Keeps prompting me about taking a long time or dying...

16.

Introducing Sage, a simple Documentation Generator for PHP

1 points · by mattsah · 13y ago · discuss

17.

A Useful Critique of PSR-X (PHP)(scriptogr.am ↗)

2 points · by mattsah · 13y ago · discuss

comment 13y ago · link · parent

I completely agree with this, and the documentation will be forthcoming on the GitHub wiki - so please follow and keep and eye out. There will also be an article at some point soon on Nettuts which will give a pretty complete example of it mimicking a new object instantiation to resolve a static dependency on an example class being tested.

comment 13y ago · link · parent

In 99% of cases I would wager you don't want your stubs to perform much logic at all. You want their returns to be a static as possible. The more logic your stubs perform the greater chance your test may fail due to an error in your test logic.

This is purposeful. The point of passing the original mime object in two-fold. It is first that it allows you to manipulate the object further when and only when the method is called. This is extremely useful for mocking/stubbing very dynamic objects whose behavior may change based on a method call. Secondly, it allows you to return the mimicked object.

Think of a method, for example that might expect two arguments, set a number of properties, and then return itself. Now imagine it has a second method, which may also alter one of those properties and return something else completely. This is pretty straightforward to do with parody:

    Mime::create('Vendor\Project\Class')
        ->onCall('method1')->expect('arg1', 2)->give(function($mime) {
            $mime->onGet('property1')->give('totally');
            $mime->onGet('property2')->give('possible');

            return $mime;
        })
        ->onCall('method2')->give(function($mime) {
            $mime->onGet('property1')->give('new value');

            return TRUE;
        });
I am not readily familiar with the syntax of other frameworks... but this seems a lot more flexible than passing arguments to the callback and forcing untested logic into the callbacks.

As I mentioned in another comment -- this is designed for very strict and context sensitive test cases. In principle, everything you should ever expect when calling a method is to give something and get something back, and maybe that it modifies a property. All of this is possible here, the logic of how it transforms what you get to what it gives is irrelevant, you should know the answer to both as a developer. And by removing that logic from the code, you "fake" only the very explicit expectations of the code you're pretending to be.

comment 13y ago · link · parent

On the heels of my post yesterday regarding Parody (http://www.github.com/dotink/parody), I am releasing Lab.

21.

Lab - A stupid testing framework for PHP(github.com ↗)

1 points · by mattsah · 13y ago · 1 comment

comment 13y ago · link · parent

I'm not sure why you would have a test function in the main app as opposed to separate testing - but yes, it would.

The intention of the AGPL is clear in my opinion and not really up for author interpretation. If someone is accessing code on a server (binary or interpreted), they have a right to obtain and modify that source code.

Aside from SaaS testing suites, I do not know of any examples where test code is accessed by users over a network.

It is, thus, 100% OK to use this source code to test a closed source project.

If the GPL had the same added clause as the AGPL, then there would be a serious number of infringing web apps.

The first sentence of the wikipedia page explains it best: "Both versions of the AGPL were designed to close a perceived application service provider "loophole" (the "ASP loophole") in the ordinary GPL, where by using but not distributing the software, the copyleft provisions are not triggered."

No use == no copyleft requirement, and I would hope it's pretty clear that simply by having a piece of AGPL software in the same directory as another piece of software that it is not inherently using it.

comment 13y ago · link · parent

I tried to clarify above.

What I am trying to get at is that traditionally web software is not distributed at all. That is, the software itself is never provided to the user and the user just interfaces with it externally.

The point regarding binary stuff was as it applies to distributed projects because if PHP or any other interpreted language is "distributed" in a traditional sense, it is already in source code.

I feel as though the confusion here is because people are looking at the initial distribution to other developers and thinking that's it. But that distribution completely allows for a developer to "link to it", modify it, and keep it behind closed doors if it is never distributed. And it isn't if it's sitting behind a web server... someone is just interfacing with it through a completely open protocol.

The point of the AGPL is to say that someone who is using a program, regardless of the fact that the program itself is never being distributed to them, has a right to get the source.

comment 13y ago · link · parent

I'm not sure I follow. Could you give a hypothetical example?

It's difficult to tell if you are only referring to the passing of the original Mime as an argument... which if you are, I presume is more a limitation of documentation. While it may be clever, it's a pretty standard use of callbacks to have arguments passed to them that may be useful inside.

comment 13y ago · link · parent

I misspoke, what I should have said is that GPL's distribution clause only pertains to binary software.

clearly if you provide someone a piece of GPL software (such as a perl script to do something useful on their server) it's GPL so it's free software and it's already source code.

The point is that the Affero clause is very clearly targets software that is being used over a network connection rather than being distributed.

It is not possible in the least that the "semantics of the communication are intimate enough" to qualify -- the semantics of the communication are HTTP, an open standard used for extremely varied purposes.

I'm quite sure the MySQL guys are simply wrong on that, but even if they're not, it's clearly not the case for HTTP.

comment 13y ago · link · parent

GPL only applies to binary software. PHP is not compiled and linked.

comment 13y ago · link · parent

Eww, bad formatting, apologize, as I'm not familiar with hacker news comment system, but you can see the case here:

https://github.com/dotink/inKWellToo/blob/master/external/te...

comment 13y ago · link · parent

Expectations and responses (provided by give()) are actually held internally. Your syntax is cleaner for very simple responses, however will become increasingly complex, particularly when the response itself is determined by a callback. Adding more params would clutter your example terribly. Also, the mime's are passed to callbacks which provide response so that additional functionality can be added, see this recent use-case:

Parody\Mime::create('App\Text') -> onCall('create') -> expect('WTF' . DS . 'Yo') -> give(function($mime) { return $mime -> onCall('underscorize') -> give('wtf' . DS . 'yo') -> resolve(); });

comment 13y ago · link · parent

Ok... I did have to increase version in composer.json though due to literal array syntax (hopefully not a deal breaker).

comment 13y ago · link · parent

GPL does not "infect" a whole project either.

GPL only requires you distribute source if you distribute the binary.

It is designed so that users maintain the right to modify software that they use.

The only difference with the Aferro clause is that it considers network use of web software to be distribution and pertains to obfuscated software (i.e. server side source) even if it's not binary.

12