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 name = "itextsharp"; | |
var dir = @"D:\Projects\Online\Service\Enhancements\Release\"; | |
var recurse = true; | |
var ns = new XmlNamespaceManager(new NameTable()); | |
ns.AddNamespace("x", "http://schemas.microsoft.com/developer/msbuild/2003"); | |
foreach (var file in Directory.EnumerateFiles(dir, "*.csproj", recurse ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly)) | |
{ |
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
$('.row').summernote({ | |
height: 150, | |
focus: true, | |
toolbar: [ | |
['style', ['bold', 'italic', 'underline']], | |
['para', ['ul', 'ol']], | |
], | |
onkeyup: function (e) { | |
$('.active_textarea').val($(this).code()); | |
$('.active_textarea').change(); |
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
http://jsfiddle.net/CrossEye/Gk6uu/light/ | |
(function(R) { | |
var incomplete = R.filter(R.where({complete: false})); | |
var sortByDate = R.sortBy(R.prop('dueDate')); | |
var sortByDateDescend = R.compose(R.reverse, sortByDate); | |
var importantFields = R.project(['title', 'dueDate']); | |
var groupByUser = R.partition(R.prop('username')); | |
var activeByUser = R.compose(groupByUser, incomplete); | |
var gloss = R.compose(importantFields, R.take(5), sortByDateDescend); |
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 class Extensions | |
{ | |
public static Task<T> Catch<T,TError> (this Task<T> task, Func<TError,T> onError) where TError : Exception | |
{ | |
var tcs = new TaskCompletionSource<T> (); | |
task.ContinueWith (ant => | |
{ | |
if (task.IsFaulted && task.Exception.InnerException is TError) | |
tcs.SetResult (onError ((TError) task.Exception.InnerException)); |
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 void WaitUnlessFault( Task[] tasks, CancellationToken token ) | |
{ | |
var cts = CancellationTokenSource.CreateLinkedTokenSource(token); | |
foreach ( var task in tasks ) { | |
task.ContinueWith(t => | |
{ | |
if ( t.IsFaulted ) cts.Cancel(); | |
}, | |
cts.Token, |
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
// https://social.msdn.microsoft.com/Forums/en-US/163ef755-ff7b-4ea5-b226-bbe8ef5f4796/is-there-a-pattern-for-calling-an-async-method-synchronously?forum=async | |
public static class AsyncHelpers | |
{ | |
/// <summary> | |
/// Execute's an async Task<T> method which has a void return value synchronously | |
/// </summary> | |
/// <param name="task">Task<T> method to execute</param> | |
public static void RunSync(Func<Task> task) | |
{ | |
var oldContext = SynchronizationContext.Current; |
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
/** | |
* Convert Excel file to Sheets | |
* @param {Blob} excelFile The Excel file blob data; Required | |
* @param {String} filename File name on uploading drive; Required | |
* @param {Array} arrParents Array of folder ids to put converted file in; Optional, will default to Drive root folder | |
* @return {Spreadsheet} Converted Google Spreadsheet instance | |
**/ | |
function convertExcel2Sheets(excelFile, filename, arrParents) { | |
var parents = arrParents || []; // check if optional arrParents argument was provided, default to empty array if not |
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.Threading.Tasks; | |
using NSubstitute; | |
using NUnit.Framework; | |
namespace ClassLibrary1 | |
{ | |
public interface ICalculationServiceAsync | |
{ | |
Task Calculate(); | |
} |
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
<UserSettings><ApplicationIdentity version="15.0"/><ToolsOptions><ToolsOptionsCategory name="Environment" RegisteredName="Environment"/></ToolsOptions><Category name="Environment_Group" RegisteredName="Environment_Group"><Category name="Environment_FontsAndColors" Category="{1EDA5DD4-927A-43a7-810E-7FD247D0DA1D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_FontsAndColors" PackageName="Visual Studio Environment Package"><PropertyValue name="Version">2</PropertyValue><FontsAndColors Version="2.0"><Theme Id="{1DED0138-47CE-435E-84EF-9EC1F439B749}"/><Categories><Category GUID="{E0187991-B458-4F7E-8CA9-42C9A573B56C}" FontName="Consolas" FontSize="8" CharSet="1" FontIsDefault="No"><Items><Item Name="SQL String" Foreground="0x00C2FEBA" Background="0x02000000" BoldFont="No"/><Item Name="Comment" Foreground="0x004AA657" Background="0x001E1E1E" BoldFont="No"/><Item Name="Keyword" Foreground="0x00D9A462" Background="0x02000000" BoldFont="No"/></Items></Category><Category GUID="{58E96763- |
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 HomeController : Controller { | |
private readonly ViewRender view; | |
public HomeController (ViewRender view) { | |
this.view = view | |
} | |
public string Test () { | |
// render ~/Views/Emails/ResetCode |