This file contains 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.IO; | |
using System.Runtime.Serialization; | |
using System.Runtime.Serialization.Formatters.Binary; | |
public static class Base64Extensions | |
{ | |
private static IFormatter GetFormatter() | |
{ | |
return new BinaryFormatter(); |
This file contains 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
@echo off | |
setlocal | |
set cn=%~1 | |
if "%cn%" == "" goto :usage | |
makecert -sv "%cn%.pvk" -n "CN=%cn%" -b 01/01/2000 -e 12/31/2999 -r "%cn%.cer" | |
pvk2pfx -pvk "%cn%.pvk" -spc "%cn%.cer" -pfx "%cn%.pfx" | |
goto :eof | |
:usage |
This file contains 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.ComponentModel.DataAnnotations; | |
using System.Reflection; | |
public sealed class ConditionalRequiredAttribute : RequiredAttribute | |
{ | |
public override bool RequiresValidationContext | |
{ | |
get { return true; } | |
} |
This file contains 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.Windows; | |
using System.Windows.Controls; | |
public class AutoGrid : Grid | |
{ | |
protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved) | |
{ | |
base.OnVisualChildrenChanged(visualAdded, visualRemoved); | |
SetCells(); | |
} |
This file contains 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
tinymce.PluginManager.add("columns", function (editor) { | |
function insert(count) { | |
editor.undoManager.transact(function () { | |
var row = editor.dom.create("div", { "class": "row" }); | |
var width = Math.ceil(12 / count); | |
for (var index = 0; index < count; index++) { | |
var column = editor.dom.add(row, "div", { "class": "col-sm-" + width }); | |
editor.dom.add(column, "p", {}, "Column " + (index + 1)); | |
} | |
var node = editor.selection.getNode(); |
This file contains 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
tinymce.PluginManager.add("paragraphs", function (editor) { | |
function insert(place) { | |
var body = editor.getBody(); | |
var paragraph = editor.dom.create("p"); | |
place(paragraph, body); | |
editor.selection.setCursorLocation(paragraph); | |
editor.nodeChanged(); | |
} | |
editor.addMenuItem("paragraph", { |
This file contains 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
tinymce.PluginManager.add("glyphicons", function (editor) { | |
function insert(name) { | |
editor.insertContent("<span class='glyphicon glyphicon-" + name + "'></span>"); | |
} | |
function getMenuItem(name) { | |
return { | |
text: name, | |
onclick: function () { | |
insert(name); |
This file contains 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
tinymce.PluginManager.add("revert", function (editor) { | |
var content; | |
editor.on("LoadContent", function () { | |
content = editor.getContent(); | |
}); | |
editor.addMenuItem("revert", { | |
text: "Revert changes", | |
context: "file", | |
onclick: function () { | |
editor.undoManager.transact(function () { |
This file contains 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
<script type="text/html" id="file-input-template"> | |
<div class="input-group"> | |
<input type="text" readonly="readonly" class="form-control" /> | |
<label class="input-group-btn"> | |
<span class="btn btn-primary"> | |
Browse | |
<input type="file" class="sr-only" /> | |
</span> | |
</label> | |
</div> |
This file contains 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
<script type="text/html" id="modal-template"> | |
<div class="modal fade"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<span class="modal-title"></span> | |
</div> | |
<div class="modal-body"></div> | |
<div class="modal-footer"></div> | |
</div> |