Skip to content

Instantly share code, notes, and snippets.

View typeoneerror's full-sized avatar
🤠
iOS, Capacitor, Ember, Vue, Rails

Benjamin Borowski typeoneerror

🤠
iOS, Capacitor, Ember, Vue, Rails
View GitHub Profile
public static function videoIdFromGoogleUrl($source)
{
$pattern = "/^(?:http:\/\/video.google.com\/(?:videoplay|googleplayer.swf)\?docid=([\w\-]+))/is";
$matches = array();
preg_match($pattern, $source, $matches);
if (isset($matches[1])) return $matches[1];
return $source;
}
$.log = function()
{
if (window.console)
{
if (window.console.log) console.log.apply(null, arguments);
}
}