Skip to content

Instantly share code, notes, and snippets.

@markleusink
markleusink / draggable.directive.ts
Last active May 7, 2024 07:59
Angular directive to make ngx-bootstrap modals draggable
import { Directive, ElementRef, HostListener, AfterViewInit } from '@angular/core';
/*
* Directive to add 'drag' support to Ngx Bootstrap modals (https://github.com/valor-software/ngx-bootstrap).
* Based on this library to enable drag support for an ng-bootstrap modal: https://github.com/mattxu-zz/ngb-modal-draggable
*
* Enable by adding the directive to the modal-header element, e.g.:
*
* <div class="modal-header" ngxModalDraggable> </div>
*/
@Danielku15
Danielku15 / Example.html
Created February 25, 2016 19:53
A MediaTypeFormatter for WebApi for multipart/form-data including file uploads
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>File Upload example</title>
<link href="/Content/bootstrap.css" rel="stylesheet" />
</head>
<body>
<form action="api/Upload" method="post">
<div class="form-group">
@aolde
aolde / BundleConfig.cs
Last active August 29, 2015 14:07
Strip console debug statements with ASP.NET Bundling
var appJs = new ScriptBundle("~/assets/app-js")
.Include(
"~/assets/scripts/main.js"
);
appJs.Transforms.Clear();
appJs.Transforms.Add(new ConfigurableJsMinify
{
CodeSettings = new CodeSettings
{
EvalTreatment = EvalTreatment.MakeImmediateSafe,