This file contains hidden or 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
| // OK, WTF is with ALL of these damn usings that are NOT EVEN USED. IMPORT ALL THE THINGS! | |
| using System; | |
| using System.Net; | |
| using System.Windows; | |
| using System.Windows.Controls; | |
| using System.Windows.Documents; | |
| using System.Windows.Ink; | |
| using System.Windows.Input; | |
| using System.Windows.Media; |
This file contains hidden or 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
| /// <summary> | |
| /// Convert to ISO 8601 Date time format (Required by Sqlite) | |
| /// </summary> | |
| /// <param name="dateTime">date to convert</param> | |
| /// <returns>date converted to ISO8601 datetime format</returns> | |
| public static string ToISO8601(this DateTime dateTime) | |
| { | |
| return dateTime.ToString("u").Replace("Z", ""); | |
| } |
This file contains hidden or 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 string ToBeTrim(this string givenString) | |
| { | |
| if (!string.IsNullOrEmpty(givenString)) | |
| return givenString.Trim(); | |
| return string.Empty; | |
| } |
This file contains hidden or 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
| phantom.casperPath = 'D:\\Dev\\Tools\\casperjs'; | |
| phantom.injectJs(phantom.casperPath + '\\bin\\bootstrap.js'); | |
| var casper = require("casper").create({ | |
| logLevel: "debug" | |
| }); | |
| var utils = require('clientutils').create(); | |
| casper.start("http://localhost:52125/ED/stockresearch/StockResearch", function() { |
This file contains hidden or 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
| [HttpPost] | |
| public ActionResult Edit(DonorViewModel model) | |
| { | |
| try | |
| { | |
| var donor = db.Donors.Get(model.Donor_ID); | |
| model.CreatedOn = donor.CreatedOn; | |
| model.DonorType_ID = donor.DonorType_ID; | |
| model.ModifiedOn = DateTime.Now; |
This file contains hidden or 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
| dynamic cutRuleParameters = new ExpandoObject(); | |
| cutRuleParameters.ToList = (Func<List<CutRuleParameterViewModel>>)(() => | |
| new List<CutRuleParameterViewModel> { | |
| new CutRuleParameterViewModel { ParamId = 77, IsDynamic = 'Y' , UIParamCode = "MedianRounding", ParamName = "MedianRounding" , ParamValue = "5000", ParamCode = "MedianRounding" }, | |
| new CutRuleParameterViewModel { ParamId = 78, ParamName = "Rounding Direction", IsDynamic = 'Y' , UIParamCode = "RoundDirection", ParamCode = "RoundingDir" } | |
| }); |
This file contains hidden or 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
| # adapted from http://notes.jimlindley.com/2008/3/25/git-svn-that-works-for-me | |
| # initial slow setup (this will scan all of the base svn repo's history, and could take hours) | |
| # - Change <svn_repo> to the base url of your svn repo, WITHOUT trunk at the end | |
| # this will point master to /trunk and allow you to point git branches to svn branches | |
| git svn clone <svn_repo> --stdlayout | |
| # initial quick clone setup | |
| # - Change $REV to the first revision of your repo, i.e. 24903 | |
| # - Change <svn_repo> to the base url of your svn repo, WITHOUT trunk at the end |
This file contains hidden or 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
| /// <summary> | |
| /// NullTask is a task that does nothing in Null Object Pattern fashion | |
| /// </summary> | |
| public class NullTask : Task | |
| { | |
| public NullTask() : base(() => { }) { } | |
| } |
This file contains hidden or 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or 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.Collections.Generic; | |
| using System.Linq; | |
| using System.Reflection; | |
| using System.Threading.Tasks; | |
| namespace Tests | |
| { | |
| public class CurrentThreadTaskScheduler : TaskScheduler | |
| { | |
| protected override void QueueTask(Task task) |