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 objectToValidate = new ObjectToValidate(); | |
var context = new ValidationContext(goUpgradesStandbyProductRequestData, null, null); | |
var results = new List<ValidationResult>(); | |
bool isValid = Validator.TryValidateObject(objectToValidate, context, results, 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
// create 'bobsburgers' if it is not already declared | |
var bobsburgers = bobsburgers || {}; | |
// create a new namespace under 'bobsburgers' | |
bobsburgers.buyburgers = (function (locallyScopedVariable) { //globallyScopedVariable got aliased to locallyScopedVariable | |
//define a function that is locally scoped | |
var _localFunction = function (params) { | |
//do something interesting | |
}; |
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
private string RenderViewToString(string viewName, object model) | |
{ | |
// assign the model of the controller from which this method was called to the instance of the passed controller (a new instance, by the way) | |
this.ViewData.Model = model; | |
// initialize a string builder | |
using (StringWriter sw = new StringWriter()) | |
{ | |
// find and load the view or partial view, pass it through the controller factory | |
ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView(this.ControllerContext, viewName); |
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
Step 1 | |
Open 'Developer Command Prompt for VS2012' and run the following: | |
makecert -r -pe -n "CN=*.bobsburgers.local" -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 | |
//We are using *.bobsburgers.local because this will allow us to use the single cert for all websites on the domain, like burgers.bobsburgers.local and fries.bobsburgers.local | |
Step 2 | |
Open IIS, expand Sites, right click first site, Edit Bindings, Add HTTPS binding, select *.bobsburgers.local cert, click ok |
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
.input-validation-error { | |
border: 2px solid #a40025 !important; | |
} |
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
.custom-checkbox input[type="checkbox"] { | |
display: inline-block; | |
width: 20px; | |
height: 20px; | |
/*hide the actual checkbox, but dont do a display none because that breaks a ton of stuff like testing frameworks*/ | |
opacity: 0.01; | |
filter: alpha(opacity=0.01); | |
cursor: pointer; | |
} |
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.Runtime.InteropServices; | |
using System.Windows; | |
using System.Windows.Interop; | |
namespace Jarloo | |
{ | |
public static class WindowExtensions | |
{ | |
#region Window Flashing API Stuff |
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
<system.diagnostics> | |
<trace autoflush="true" /> | |
<sources> | |
<source name="System.ServiceModel" | |
switchValue="Information, ActivityTracing" | |
propagateActivity="true"> | |
<listeners> | |
<add name="sdt" | |
type="System.Diagnostics.XmlWriterTraceListener" | |
initializeData="c:logclient.svclog" /> |
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 ObjectExtensions | |
{ | |
/// <summary> | |
/// The string representation of null. | |
/// </summary> | |
private static readonly string Null = "null"; | |
/// <summary> | |
/// The string representation of exception. | |
/// </summary> |
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
use Database | |
go | |
execute as user = 'Some_User' | |
go | |
select has_perms_by_name('p', 'OBJECT', 'execute') as HasRights, name from sys.procedures | |
go | |
revert --This will discontinue the above EXECUTE AS to stop you from impersonating Some_User |
OlderNewer