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
| function getModelPrefix(fieldName) { | |
| return fieldName.substr(0, fieldName.lastIndexOf(".") + 1); | |
| } | |
| function appendModelPrefix(value, prefix) { | |
| if (value.indexOf("*.") === 0) { | |
| value = value.replace("*.", prefix); | |
| } | |
| return value; | |
| } |
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
| var mimeMappingFromFileName = System.Web.MimeMapping.GetMimeMapping("Filename"); |
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; | |
| using System.IO; | |
| using System.Net.Mail; | |
| namespace EmailValidator | |
| { | |
| class Program | |
| { | |
| static void Main() | |
| { |
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
| function htmlEncode(html) { | |
| return document.createElement('div').appendChild( | |
| document.createTextNode(html)).parentNode.innerHTML; | |
| }; | |
| function htmlDecode(html) { | |
| var div = document.createElement('div'); | |
| div.innerHTML = html; | |
| return div.textContent; | |
| }; |
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
| var implementations = Assembly.GetExecutingAssembly().GetTypes() | |
| .Where(x => typeof(IInterface).IsAssignableFrom(x) && | |
| !x.IsInterface && | |
| !x.IsAbstract && | |
| x.IsClass && | |
| x.IsPublic) | |
| .Select(x => Activator.CreateInstance(x) as IInterface); |
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
| .tt-hint, .tt-input { | |
| display: block; | |
| width: 100%; | |
| padding: 3px 6px; | |
| color: #555; | |
| vertical-align: middle; | |
| background-color: #ffffff; | |
| border: 1px solid #cccccc; | |
| border-radius: 4px; | |
| } |
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
| console.table(data); |
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
| protected void Application_BeginRequest() | |
| { | |
| if (Request.Headers.AllKeys.Any(x => x.ToUpper() == "ORIGIN") && Request.HttpMethod.ToUpper() == "OPTIONS") | |
| { | |
| Response.Flush(); | |
| } | |
| } | |
| <customHeaders> | |
| <remove name="X-Powered-By" /> |
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
| To be ran against mongo.exe | |
| // Start up - specify db file location | |
| "PathToMongo.exe" --dbpath C:\mongodb\data | |
| // Connect to shell | |
| mongo --port 27017 -u "username" -p "password" --authenticationDatabase "admin" | |
| Option param --nodb | |
| // Select db |
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
| Update nuget.exe | |
| nuget.exe update -self | |
| Update source credentials so you don't have to keep entering them over and over | |
| nuget.exe sources Update||Add -Name sourceNameHere -UserName userNameHere -Password passwordHere -Source sourceUrlHere |