This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function AccurateDuration($ytDuration) { | |
$di = new DateInterval($ytDuration); | |
// h i s | |
$dur = ''; | |
if (!$di->h == 0){ | |
if (strlen($di->h) == 1){ | |
$dur .= '0'.$di->h.':'; | |
}else{ | |
$dur .= $di->h.':'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
simple function to get addition of some or more varible at once without doing much coding | |
just use addition(2,3,4,3/4,2-1); you can use what ever you want | |
*/ | |
function addition(){ | |
$output = 0; | |
$arguments = func_get_args(); | |
foreach ($arguments as $arg){ | |
$output += $arg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Snippet Name: Embed Code Generator | |
Author: Muhammad Yaser | |
Description: this is simple class that will generate videos embed tags. width and height is not included in iframe tags. | |
you need to use fitvid.js. fitvids is jQuery Plugin this will alow you to auto resize video player in a container. | |
you are allowed to use this file anywhere you want. you are allowed to modify this file without any restriction. | |
you are allowed to use this file in commerical project. | |
Supported filehost: only 7 videosharing website are supported. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
this simple snippets will give you downloadable url of soundcloud. | |
just slap soundcloud url like this way in csharp Download('Soundcloud url'); this will returned downloadable url | |
*/ | |
public string Download(string songurl){ | |
string returned = null; | |
HttpWebRequest hc = (HttpWebRequest)WebRequest.Create(songurl); | |
hc.UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36"; | |
HttpWebResponse hresponse = (HttpWebResponse)hc.GetResponse(); | |
System.IO.StreamReader sr = new System.IO.StreamReader(hresponse.GetResponseStream()); |