http://twitter.com/share?text=<TITLE>&url=<URL>
E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com
http://www.facebook.com/sharer.php?u=&p[title]=
<?php | |
abstract class TestCase extends \PHPUnit_Framework_TestCase | |
{ | |
protected function assertException(callable $callback, $expectedException = 'Exception', $expectedCode = null, $expectedMessage = null) | |
{ | |
$expectedException = ltrim((string) $expectedException, '\\'); | |
if (!class_exists($expectedException) && !interface_exists($expectedException)) { | |
$this->fail(sprintf('An exception of type "%s" does not exist.', $expectedException)); | |
} |
<?php | |
// Output screenshot: | |
// http://cl.ly/NsqF | |
// ------------------------------------------------------- | |
include_once 'console.php'; | |
// ::log method usage | |
// ------------------------------------------------------- | |
Console::log('Im Red!', 'red'); |
#!/usr/bin/env bash | |
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
# Versions | |
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE` |
// key will be 0,1,2,... | |
Collection::macro('transpose', function() { | |
$items = array_map(function(...$items) { | |
return $items; | |
}, ...$this->values()); | |
return new self($items); | |
}); | |
// transpose(['name', 'email']) |
/** | |
* base64ToFile | |
* @param $base64 | |
* @param $path | |
* @param int $width | |
* @param int $height | |
* @return string | |
* @info usage 'Image' => Intervention\Image\Facades\Image::class | |
*/ | |
public static function base64ToFile($base64, $path, $width = 400, $height = 400) |
// Fast and easy way to combine (additive mode) two RGBA colors with JavaScript. | |
// [red, green, blue, alpha] based on these maximul values [255, 255, 255, 1]. | |
var base = [69, 109, 160, 1]; | |
var added = [61, 47, 82, 0.8]; | |
var mix = []; | |
mix[3] = 1 - (1 - added[3]) * (1 - base[3]); // alpha | |
mix[0] = Math.round((added[0] * added[3] / mix[3]) + (base[0] * base[3] * (1 - added[3]) / mix[3])); // red | |
mix[1] = Math.round((added[1] * added[3] / mix[3]) + (base[1] * base[3] * (1 - added[3]) / mix[3])); // green | |
mix[2] = Math.round((added[2] * added[3] / mix[3]) + (base[2] * base[3] * (1 - added[3]) / mix[3])); // blue |
// SET THE input old value with following values Input::old('key'); | |
Session::set('_old_input.key', Input::get('value')); |
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script> | |
<form method="POST" enctype="multipart/form-data" action="https://www.google.com/save" id="myForm"> | |
<input type="hidden" name="img_val" id="img_val" value="" /> | |
</form> | |
<div id="more"> | |
<h1 style='color: red'> hello </h1> | |
<iframe src="https://tags.mli.me/12751"> | |
</iframe> |
<?php | |
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
// http://youtu.be/dQw4w9WgXcQ | |
// http://www.youtube.com/embed/dQw4w9WgXcQ | |
// http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
// http://www.youtube.com/?v=dQw4w9WgXcQ | |
// http://www.youtube.com/v/dQw4w9WgXcQ | |
// http://www.youtube.com/e/dQw4w9WgXcQ | |
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ |