This file contains hidden or 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
import videojs from 'video.js'; | |
const Html5 = videojs.getTech('Html5'); | |
const supportsSrcObject = 'srcObject' in HTMLMediaElement.prototype; | |
export default class MediaStreamTech extends Html5 { | |
/** | |
* A getter/setter for the `Html5` Tech's source object. | |
* > Note: Please use {@link Html5#setSource} | |
* |
This file contains hidden or 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 formatMyDate($locale, $pattern, $year, $month, $day) { | |
$timezone = new \DateTimeZone('Asia/Tehran'); | |
$dateTime = new \DateTime('now', $timezone); | |
$dateTime->setDate($year, $month, $day); | |
$timeStamp = $dateTime->getTimestamp(); | |
$dateFormatter = new \IntlDateFormatter( | |
$locale, | |
\IntlDateFormatter::FULL, | |
\IntlDateFormatter::FULL, | |
$timezone, |
This file contains hidden or 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
if(!Array.prototype.isArray){ | |
Array.prototype.isArray = function (variable) { | |
return variable.constructor === Array; | |
} | |
} | |
function flatten(arr, result) { | |
result = result || []; | |
for (let i = 0, length = arr.length; i < length; i++) { | |
var value = arr[i]; |
This file contains hidden or 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
/* EventManager, v1.0.1 | |
* | |
* Copyright (c) 2009, Howard Rauscher | |
* Licensed under the MIT License | |
*/ | |
(function() { | |
function EventManager() { | |
this._listeners = {}; |
This file contains hidden or 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
//if you are trying to read a webpage using webclient or webrequest and getting very diffrent data than the browser | |
//the chances are that the content is compressed | |
//but if you are reciving correct html but diffrent than the browser then you should set a correct UserAgent | |
System.Net.HttpWebRequest r = (System.Net.HttpWebRequest)System.Net.WebRequest.Create("http://kat.cr/"); | |
r.AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate; | |
r.UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0"; | |
System.Net.HttpWebResponse resp = (System.Net.HttpWebResponse)r.GetResponse(); | |
System.IO.Stream respS = resp.GetResponseStream(); | |
System.IO.StreamReader sr = new System.IO.StreamReader(respS, System.Text.Encoding.GetEncoding(1252)); |
This file contains hidden or 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
//Its very tricky to load LINK tags dynamicly and listen to their onload event, i found lots of hacks and tricks. | |
//This is the best and cleanest option that i came up with | |
//Basicly you just load the link file with ajax and put it inside a STYLE tag. | |
//This is a pure JS solution, no jQuery | |
function createXMLHTTPObject() { | |
var XMLHttpFactories = [ | |
function () {return new XMLHttpRequest()}, | |
function () {return new ActiveXObject("Msxml2.XMLHTTP")}, |
This file contains hidden or 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
angular.module('myModule') | |
.factory('dataLoader', ['$http', function ($http) { | |
var __list = null; | |
var __request = null; | |
return function (callbak) { | |
if (__list) | |
callbak(__list); | |
else { | |
if (!__request) | |
__request = $http({ |
This file contains hidden or 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 (angular) { | |
var origMethod = angular.module; | |
angular.module = function (name, reqs, configFn) { | |
var module = origMethod(name, reqs, configFn); | |
module.run(function ($rootScope) { | |
$rootScope.$on('$viewContentLoaded', function () { | |
var appEl = angular.element(' [ng-view],ng-view,.ng-view', '[ng-app="' + name + '"]'); |
This file contains hidden or 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
if (!Array.prototype.indexOf) { | |
Array.prototype.indexOf = function (needle) { | |
for (var i = 0; i < this.length; i++) { | |
if (this[i] === needle) { | |
return i; | |
} | |
} | |
return -1; | |
}; | |
} |
This file contains hidden or 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
var __browser = null; | |
(function (angular) { | |
var origMethod = angular.module; | |
angular.module = function (name, reqs, configFn) { | |
var module = origMethod(name, reqs, configFn); | |
///////////////////// override the browser service | |
module.config(['$provide', '$compileProvider', '$routeProvider', function ($provide, $compileProvider, $routeProvider) { |