- https://github.com/danialfarid/angular-file-upload
- https://github.com/twilson63/ngUpload
- http://blueimp.github.io/jQuery-File-Upload/angularjs.html
- http://blog.brunoscopelliti.com/a-directive-to-manage-file-upload-in-an-angularjs-application
- http://badwing.com/multipart-form-data-ajax-uploads-with-angularjs/
- http://shazwazza.com/post/Uploading-files-and-JSON-data-in-the-same-request-with-Angular-JS
- http://flowjs.github.io/ng-flow/
- http://uncorkedstudios.com/blog/multipartformdata-file-upload-with-angularjs
- http://badwing.com/multipart-form-data-ajax-uploads-with-angularjs/
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
public static bool UploadToServer(string pathToFile) | |
{ | |
bool failure = false; | |
if (!FileUpload1.FileName.ToLowerInvariant().EndsWith(".xml")) { | |
failure = true; | |
} | |
StreamReader reader = new StreamReader(FileUpload1.FileContent); | |
string xmlContent = reader.ReadToEnd(); | |
if (!xmlContent.TrimStart().StartsWith("<?xml")) { |
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
if (fuImage.HasFile) | |
{ | |
PostedMediaFile postedMediaFile = new PostedMediaFile | |
{ | |
ContentLength = fuImage.PostedFile.ContentLength, | |
ContentType = fuImage.PostedFile.ContentType, | |
FileName = fuImage.PostedFile.FileName, | |
InputStream = fuImage.PostedFile.InputStream | |
}; | |
Media media = MediaFactory.GetMediaFactory(-1, postedMediaFile, new umbraco.BusinessLogic.User(0)).HandleMedia(-1, postedMediaFile, new umbraco.BusinessLogic.User(0), 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
<configSections> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> | |
</configSections> | |
<log4net> | |
<appender name="OutputDebug" type="log4net.Appender.OutputDebugStringAppender, log4net"> | |
<layout type="log4net.Layout.PatternLayout,log4net"> | |
<conversionPattern value="%d [%t] %-5p %c - %m%n"/> | |
</layout> | |
</appender> |
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 Umbraco.Core.Models; | |
@using Umbraco.Core.Services; | |
var contentTypeService = ApplicationContext.Current.Services.ContentTypeService; | |
var contentType = contentTypeService.GetContentType(4200); | |
contentType.ParentId=3130; | |
contentTypeService.Save(contentType); |
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
Here are all the classes from Bootstrap 3 (version 3.1.1). | |
Method of extraction: | |
1. Download Bootstrap 3 and rename bootstrap.css as "bootstrap.html" | |
2. Add the following 24 lines of code to the very bottom of the bootstrap.html file: | |
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script> | |
<script> |
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
string simpleString = "this string will be cached"; | |
HttpRuntimeCache cache = new HttpRuntimeCache(); | |
cache.Add("simpleString", simpleString); | |
string fromCache = cache.Get("simpleString") as string; | |
cache.Remove("simpleString"); |
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
var stopwatch = Stopwatch.StartNew(); | |
for (int i = 1; i < 1000000000; i++) | |
{ | |
// run method here | |
} | |
stopwatch.Stop(); | |
Console.writeline("Elapsed time: {0}", stopwatch.Elapsed); |
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
public class FormsValidation : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
Umbraco.Forms.Web.Controllers.UmbracoFormsController.FormValidate += UmbracoFormsController_FormValidate; | |
} | |
void UmbracoFormsController_FormValidate(object sender, Umbraco.Forms.Mvc.FormValidationEventArgs e) | |
{ |
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
-- Umbraco Clear Old Document Versions To Decrease Database Size And Improve Performance | |
-- http://borism.net/2008/12/16/fixing-a-large-cmspropertydata-table-in-umbraco/ | |
DECLARE @createdDate Datetime = DATEADD(m, -1, getdate()) | |
-- dump logs | |
-- TRUNCATE TABLE umbracolog -- faster if log table is very big and you don't need anything | |
DELETE FROM umbracolog WHERE Datestamp < @createdDate | |
-- clean up old versions | |
DELETE FROM cmsPropertyData WHERE |
OlderNewer