$ SetFile -a "v" www
$ SetFile -a "V" www
$ defaults write com.apple.Finder AppleShowAllFiles YES
@interface NSString (FXNSStringAdditions) | |
- (NSString *)urlEncoded; | |
- (NSString *)urlDecoded; | |
@end | |
@implementation NSString (FXNSStringAdditions) | |
- (NSString *)urlEncoded { |
An /etc/fstab example: | |
# Identifier, mount point, fs type, options1 | |
UUID=DF000C7E-AE0C-3B15-B730-DFD2EF15CB91 /export ufs ro | |
UUID=FAB060E9-79F7-33FF-BE85-E1D3ABD3EDEA none hfs rw,noauto | |
LABEL=This40Is40The40Volume40Name none msdos ro | |
The Identifier is used to identify the volume; the LABEL is the volume name, the UUID is the Universal Unique Identifier Drive. You can use both, but the UUID is the best choice because renaming the volume will not change this identifier. | |
The mount point is the directory used when the volume is mounted; set none to use the pre-defined OS X directory, i.e. ./Volumes/ | |
The fs type describes the type of the filesystem; use hfs for a Mac volume. The field options describes the mount options associated with the filesystem. The option autowill mount the volume in the normal way, noauto will force the volume not to be mounted automatically; and last, use rw or ro for a read-write or read-only disk. |
var bucketize = (x: any[], nInBucket: number) => { | |
var i = 0.0; | |
var iX = _.map(x, (x) => { return { i: i++, x: x }; }); | |
var groupedItems = _.groupBy(iX, (ixGrp) => { return Math.floor(ixGrp.i / nInBucket); }); | |
return _.map(_.values(groupedItems), (group: any[]) => { | |
return _.pluck(group, 'x'); | |
}); | |
} |
// jQuery popovers normally have to be initialized on a href with javascript. By hooking in to the click event instead, we can do the same without | |
// explicitely having to init, which is useful for pages with a dynamic dom | |
$(document).on('focusin click', '[data-toggle="popover"]', function (e) { | |
e.preventDefault(); | |
var $element = $(e.target); | |
if (!$element.has('[data-toggle="popover"]')) { | |
$element = $element.closest('[data-toggle="popover"]'); | |
} | |
($element).popover(); | |
}); |
public class AllowCrossSiteJsonAttribute : ActionFilterAttribute | |
{ | |
public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) | |
{ | |
if (actionExecutedContext.Response != null) | |
actionExecutedContext.Response.Headers.Add("Access-Control-Allow-Origin", "*"); | |
base.OnActionExecuted(actionExecutedContext); | |
} | |
} |
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] | |
public sealed class NoCacheAttribute : ActionFilterAttribute | |
{ | |
public override void OnResultExecuting(ResultExecutingContext filterContext) | |
{ | |
filterContext.HttpContext.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); | |
filterContext.HttpContext.Response.Cache.SetValidUntilExpires(false); | |
filterContext.HttpContext.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); | |
filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache); | |
filterContext.HttpContext.Response.Cache.SetNoStore(); |
sudo python -m SimpleHTTPServer 801 |
//Example usage | |
// | |
//var customControllerActivator = new CustomControllerActivator(); | |
//customControllerActivator.AddType(() => new MyApiController()); | |
//httpConfiguration.Services.Replace(typeof(IHttpControllerActivator),customControllerActivator); | |
class CustomControllerActivator : IHttpControllerActivator | |
{ | |
readonly Dictionary<Type, Func<IHttpController>> _dictionary = new Dictionary<Type, Func<IHttpController>>(); |
public sealed class GZipMiddleware { | |
private readonly Func<IDictionary<string, object>, Task> next; | |
public GZipMiddleware(Func<IDictionary<string, object>, Task> next) { | |
this.next = next; | |
} | |
public async Task Invoke(IDictionary<string, object> environment) { | |
var context = new OwinContext(environment); |