##Install Xcode command line tools
Xcode>Preferences>Downloads
Enable root if not already enabled: http://support.apple.com/kb/PH11331?viewlocale=en_US
##Apache
Apache is already installed, just not running.
using System; | |
using System.IO; | |
using System.Messaging; | |
using System.Text; | |
using Newtonsoft.Json; | |
public class JsonMessageFormatter : IMessageFormatter | |
{ | |
private static readonly JsonSerializerSettings DefaultSerializerSettings = | |
new JsonSerializerSettings { |
<snippet> | |
<content><![CDATA[ | |
<!doctype html> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> |
<snippet> | |
<!-- put this file in /packages/User/<Folder Name>/console_log.sublime-snippet then restart your Sublime Text 2 --> | |
<content><![CDATA[console.log($1);$0]]></content> | |
<tabTrigger>conl</tabTrigger> | |
<scope>text.html,source.js</scope> | |
<description>console.log()</description> | |
</snippet> | |
<snippet> | |
<!-- put this in another file /packages/User/<Folder Name>/console_dir.sublime-snippet then restart your Sublime Text 2 --> |
(function ($) { | |
$.validator.addMethod("notequal", function (value, element, param) { | |
return this.optional(element) || value != $(param).val(); | |
}, "This has to be different..."); | |
$.validator.unobtrusive.adapters.add("notequal", ["field"], function (options) { | |
options.rules["notequal"] = options.params.field; | |
if (options.message) options.messages["notequal"] = options.message; | |
}); | |
})(jQuery); |
##Install Xcode command line tools
Xcode>Preferences>Downloads
Enable root if not already enabled: http://support.apple.com/kb/PH11331?viewlocale=en_US
##Apache
Apache is already installed, just not running.
public interface IBackgroundWorker | |
{ | |
Task<TOutput> Run<TInput, TOutput>(Func<TInput, TOutput> action); | |
Task Run(Action action); | |
Task Run<TInput>(Action<TInput> action); | |
} | |
public sealed class BackgroundWorker : IBackgroundWorker | |
{ | |
public Task<TOutput> Run<TInput, TOutput>(Func<TInput, TOutput> action) |
public class WebApplication : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
RouteTable.Routes.MapRoute("HttpProxy", "proxy/{*path}", new { controller = "Proxy", action = "Http" }) | |
} | |
} |
Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.
loosely based on https://gist.github.com/bnerd/2011232
// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
# Based on http://unix.stackexchange.com/questions/14303/bash-cd-up-until-in-certain-folder/14311#14311 | |
# Jump to closest matching parent directory | |
upto () { | |
if [ -z "$1" ]; then | |
return | |
fi | |
local upto=$@ | |
cd "${PWD/\/$upto\/*//$upto}" | |
} | |
# Auto-completion |