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
#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() |
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
## based on https://github.com/lioonline/OS-X-El-Capitan | |
## pkg file link - http://osxapps.itunes.apple.com/apple-assets-us-std-000001/Purple3/v4/74/d2/82/74d28291-9db9-7ae2-305d-9b8b3f5fd463/ftk3252456602304584541.pkg | |
# Run this from folder where you have downloaded or copied ftk3252456602304584541.pkg file | |
#create a tmp folder | |
mkdir elCapitanRoot && cd elCapitanRoot | |
#create a folder structure to match apple server | |
sudo mkdir -p ./apple-assets-us-std-000001/Purple3/v4/74/d2/82/74d28291-9db9-7ae2-305d-9b8b3f5fd463/ |
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 void RegisterSoapExtension(Type type, int priority, PriorityGroup group) | |
{ | |
if (!type.IsSubclassOf(typeof(SoapExtension))) | |
{ | |
throw new ArgumentException("Type must be derived from SoapException.", nameof(type)); | |
} | |
if (priority < 1) | |
{ | |
throw new ArgumentOutOfRangeException(nameof(priority), priority, "Priority must be greater or equal to 1."); |