dev-master
9999999-devA friendly, error prone coding companion
The Requires
The Development Requires
v1.0
1.0.0.0A friendly, error prone coding companion
The Requires
The Development Requires
Wallogit.com
2017 © Pedro Peláez
A friendly, error prone coding companion
Inspired by the revolutionary work done by @drathier and their stack-overflow-import, Stack Overflow Buddy is your own personal PHP based Stack Overflow assistant!, (*1)
Why spend your valuable time cutting and pasting from StackOverflow when Stack Overflow Buddy can do it for you? Who wouldn't trade all safety checks and only the basest of functionality checks for a bit of convenience?, (*2)
composer require brandonshar/stack-overflow-buddy
Because Stack Overflow Buddy uses untagged libraries, you may need to add the following lines to your composer root, (*3)
"minimum-stability": "dev", "prefer-stable": true
```php, (*4)
use brandonshar\StackOverflowBuddy;, (*5)
--- ### What's it do? Just give it a try! ```php StackOverflowBuddy::mergeSort([2,3,1,4]); // [1, 2, 3, 4]
Impressed?, (*6)
How about, (*7)
StackOverflowBuddy::substringBetweenTwoStrings('platypus', 'pl', 'us');
// atyp
If you're impressed, you should probably stop reading here., (*8)
It certainly will. But don't forget to use some of that time you're saving to thank the original author of the code you've now absorbed., (*9)
var_dump(StackOverflowBuddy::giveThanksFor('substringBetweenTwoStrings'));
/*
["author"]=>
string(18) "Alejandro Iglesias"
["authorLink"]=>
string(57) "https://stackoverflow.com/users/425741/alejandro-iglesias"
["questionLink"]=>
string(35) "https://stackoverflow.com/a/9826656"
*/
In the incredibly unlikely (ok... maybe not incredibly unlikely) event that StackOverflowBuddy can't find any code that meets your request, it'll throw you a HaveToWriteYourOwnCodeException to keep you busy while hopefully someone else gives a better answer on Stack Overflow., (*10)
If you're still on the fence, don't take my word for it; here's what a satisifed reader of the code had to say:, (*11)
"I love how this makes on the fly software updates really easy. If I ever need to tweak an algorithm or fix a bug, I just need to submit a really good answer to stack overflow with the updated code. Goodbye source control!", (*12)
You're free to use this package, but if it makes it to your production environment you accept the responsibility of personally telling each of your users that they would be better off hiding their data under their mattress., (*13)
Keep in mind that every usage of this makes two requests to the StackOverflow API and they will rate-limit you after a certain number of requests per day. But that shouldn't really be an issue since no one sensible would ever use this for anything., (*14)
Have a blast. There is currently only one end to end integration test that requires the index.php file to be reachable from a local server. I just used Laravel Valet. This code does not follow PSR-2 and deliberately uses no typehints or visiblity as I decided to do a similar style experiment to the required Zttp library. Even if you're the strictest PHP writer there is, not following a style guide is at best, like the 5th reason you should never use this code., (*15)
The Unlicense. If there's a less restrictive license with even less liability, let's go with that. Anyone who thinks that using this license is to the detriment of my heirs clearly didn't look at it very carefully., (*16)
A friendly, error prone coding companion
A friendly, error prone coding companion