News for hackers. Stuff that matters.

mattsah

Re:Patturns: A Silly Little Pattern Workspace on Wednesday February 25, 2015 @04:46AM (#9106044)
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.

How's the Linux support?
Re:Homebrew Beer Recipes on Wednesday June 19, 2013 @05:33PM (#5908455)
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

Re:Homebrew Beer Recipes on Wednesday June 19, 2013 @04:47PM (#5908102)
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.

Re:Googlebot snarfing URLs from the ether? on Sunday June 02, 2013 @11:29AM (#5808839)
Did you use Chrome to access the URL?
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.

Re:Apparently We're Not Ready to Be Adults About Anything on Wednesday March 20, 2013 @12:52AM (#5405721)
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.

Unlike Ruby devs we don't need to pray to God every time we deploy our code?
Re:Gistflow on Friday February 22, 2013 @04:06AM (#5263420)
Bigger inconvenience in Firefox 19:

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

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

Introducing Sage, a simple Documentation Generator for PHP

Sage is a simple and flexible documentation generator for PHP code. It outputs basic API documentation in markdown format suitable for projects which use GitHub, but most other markdown tools should be able to parse and format it properly.This is extremely well suited for creating API documentation that can be browsed and and is visible in your source tree on GitHub.Also, because it uses...

( Read More... | no comments | on HN )
Re:Parody – a PHP testing library on Wednesday January 16, 2013 @09:22PM (#5070556)
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.
Re:Parody – a PHP testing library on Monday January 14, 2013 @03:18AM (#5053788)
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.

Re:Lab - A stupid testing framework for PHP on Sunday January 13, 2013 @04:51PM (#5052009)
On the heels of my post yesterday regarding Parody (http://www.github.com/dotink/parody), I am releasing Lab.
Re:Parody – a PHP testing library on Sunday January 13, 2013 @03:28PM (#5051758)
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.

Re:Parody – a PHP testing library on Sunday January 13, 2013 @02:21PM (#5051549)
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.

Re:Parody – a PHP testing library on Sunday January 13, 2013 @02:12PM (#5051510)
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.

Re:Parody – a PHP testing library on Sunday January 13, 2013 @02:10PM (#5051506)
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.

Re:Parody – a PHP testing library on Sunday January 13, 2013 @05:59AM (#5050518)
GPL only applies to binary software. PHP is not compiled and linked.
Re:Parody – a PHP testing library on Sunday January 13, 2013 @02:50AM (#5050256)
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...

Re:Parody – a PHP testing library on Sunday January 13, 2013 @02:49AM (#5050255)
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(); });

Re:Parody – a PHP testing library on Saturday January 12, 2013 @07:56PM (#5049517)
Ok... I did have to increase version in composer.json though due to literal array syntax (hopefully not a deal breaker).
Re:Parody – a PHP testing library on Saturday January 12, 2013 @07:39PM (#5049479)
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.

Older »