echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
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
| // Originally inspired by David Walsh (https://davidwalsh.name/javascript-debounce-function) | |
| // Returns a function, that, as long as it continues to be invoked, will not | |
| // be triggered. The function will be called after it stops being called for | |
| // `wait` milliseconds. | |
| const debounce = (func, wait) => { | |
| let timeout; | |
| return function executedFunction(...args) { | |
| const later = () => { |
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
| // This code snippet requires jQuery to be loaded onto the page. | |
| /** | |
| * Wraps jQuery's ajax implementation inside an ES6 Promise structure. | |
| * Source: https://stackoverflow.com/questions/35135110/jquery-ajax-with-es6-promises | |
| * @function ajax | |
| * @param {object} options - The config to pass to the ajax call. | |
| * @return {object} - A Promise object to complete an ajax call. | |
| */ | |
| function ajax(options) { |
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 <AVFoundation/AVFoundation.h> | |
| @interface MLWAsyncAVPlayer : AVPlayer | |
| @end |
- arrays: https://gist.github.com/ourmaninamsterdam/1be9a5590c9cf4a0ab42
- questions: https://gist.github.com/ourmaninamsterdam/800ea80d463a72711adf#html
- random str: https://gist.github.com/ourmaninamsterdam/122d97d549e609e458fa
- async wait https://ponyfoo.com/articles/understanding-javascript-async-await
- es6 https://ponyfoo.com/articles/es6
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
| public async Task<IHttpActionResult> SaveFile(string diskFolderPath) | |
| { | |
| var path = Path.GetTempPath(); | |
| if (!Request.Content.IsMimeMultipartContent("form-data")) | |
| { | |
| throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.UnsupportedMediaType)); | |
| } | |
| MultipartFormDataStreamProvider streamProvider = new MultipartFormDataStreamProvider(path); |
In ASP.NET MVC there are three ways - ViewData, ViewBag and TempData to pass data from controller to view and in next request. Like WebForm, you can also use Session to persist data during a user session. Now question is that when to use ViewData, VieBag, TempData and Session. Each of them has its own importance. In this article, I am trying to explain the differences among these four.
ViewData is a dictionary object that is derived from ViewDataDictionary class.
public ViewDataDictionary ViewData { get; set; }
ViewData is a property of ControllerBase class. ViewData is used to pass data from controller to corresponding view. It’s life lies only during the current request.
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
| <?xml version="1.0" encoding="us-ascii"?> | |
| <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vs="http://schemas.microsoft.com/Visual-Studio-Intellisense" elementFormDefault="qualified" attributeFormDefault="unqualified" vs:helpNamespace="http://schemas.microsoft.com/.NetConfiguration/v2.0"> | |
| <xs:element name="configuration"> | |
| <xs:complexType> | |
| <xs:choice minOccurs="0" maxOccurs="unbounded"> | |
| <xs:any namespace="##any" processContents="lax" /> | |
| </xs:choice> | |
| </xs:complexType> | |
| </xs:element> | |
| <xs:element name="location"> |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.IO.Compression; | |
| using System.Linq; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| using System.Net.Mail; | |
| using System.Web; | |
| using System.Xml.Serialization; |
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
| public static class Fakes | |
| { | |
| public static UrlHelper FakeUrlHelper(HttpContextBase httpContext, RouteData routeData, RouteCollection routeCollection) | |
| { | |
| var requestContext = new RequestContext(httpContext, routeData); | |
| var urlHelper = new UrlHelper(requestContext, routeCollection); | |
| return urlHelper; | |
| } | |
| public static RouteCollection GetRouteCollection() |
