Skip to content

Instantly share code, notes, and snippets.

@vanillajonathan
vanillajonathan / Index.cshtml
Last active October 31, 2023 12:42
TinyMCE image upload on ASP.NET MVC
<script src="//tinymce.cachefly.net/4.2/tinymce.min.js"></script>
<script>
tinymce.init({
selector: 'textarea',
images_upload_url: "TinyMceUpload",
});
function upload(form) {
tinymce.activeEditor.uploadImages(function (success) {
form.submit();
@vanillajonathan
vanillajonathan / index.html
Created September 22, 2015 17:28
Input validation with Bootstrap warning
<div class="form-group">
<label class="control-label" for="url">URL</label>
<input class="form-control" type="url" id="url" placeholder="https://api.example.com/" />
<p class="help-block" id="url-help"></p>
</div>
@vanillajonathan
vanillajonathan / Main.cs
Last active August 14, 2020 09:57
A very basic general-purpose substitution-based template engine.
public void Main()
{
var template = "Hello {{Name}}, how are you?";
var model = new { Name = "Alice" };
var output = TemplateEngine.Execute(template, model);
// Output: "Hello Alice, how are you?"
}