Skip to content

Instantly share code, notes, and snippets.

View mxmissile's full-sized avatar
🎯
Focusing

Travis mxmissile

🎯
Focusing
View GitHub Profile
### Keybase proof
I hereby claim:
* I am mxmissile on github.
* I am mxmissile (https://keybase.io/mxmissile) on keybase.
* I have a public key ASBeoE5HDu-ITNl49iz5DepOizRs-oKeuUv27V18Ypq1ygo
To claim this, I am signing this object:
@mxmissile
mxmissile / autmapper_test.cs
Created September 11, 2020 20:24
automapper test
public void mappingtest()
{
var config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<Asset, AssetDetailsDTO>()
.ForMember(dto => dto.RequestId, conf => conf.MapFrom(x => x.Request.UUID));
});
var mapper = config.CreateMapper();
var guid = Guid.NewGuid();
main.2ae54a5bcaf9cea1014f.bundle.js:1 ERROR TypeError: Cannot read property 'src' of null
at Object.submit (zuora.min.js:31)
at n.submit (main.2ae54a5bcaf9cea1014f.bundle.js:1)
at n.startZuora (main.2ae54a5bcaf9cea1014f.bundle.js:1)
at n.process (main.2ae54a5bcaf9cea1014f.bundle.js:1)
at e._next (main.2ae54a5bcaf9cea1014f.bundle.js:1)
at e.__tryOrSetError (main.2ae54a5bcaf9cea1014f.bundle.js:1)
at e.next (main.2ae54a5bcaf9cea1014f.bundle.js:1)
at e._next (main.2ae54a5bcaf9cea1014f.bundle.js:1)
at e.next (main.2ae54a5bcaf9cea1014f.bundle.js:1)
public class CommandNameHandler : IRequestHandler<source, destination>
{
public CommandNameHandler(IDb db)
{
_db = db;
}
private IDb _db;
// constructors and privates
var d = new Dictionary<string, object>();
d.Add("RefId", 1);
var types = new List<string>();
types.Add("fruit");
types.Add("veg");
types.Add("fung");
var foodList = session.QueryOver<Food>()
.Where(NHibernate.Criterion.Restrictions.AllEq(d) && NHibernate.Criterion.Restrictions.In("Type", types));
public class PostalAddressMap
: ClassMap<PostalAddress>
{
public PostalAddressMap()
{
Table("tblPostalAddresses");
Id(x => x.Id);
Map(x => x.Address);
Map(x => x.AddressType);
Map(x => x.Owner);
@mxmissile
mxmissile / gist:d81682def1d88a522767
Created August 27, 2015 19:39
Fluent Nhibernate Specs
var addresses = new[] {new PostalAddress(), new PostalAddress()};
var spec = new PersistenceSpecification<Contact>(session);
spec.CheckProperty(p => p.Name, "something")
.CheckProperty(p => p.GivenName, "something else")
.CheckInverseList(l => l.Addresses, addresses)
etc etc
.VerifyTheMappings();
@mxmissile
mxmissile / gist:019294152da407ca52f1
Created September 3, 2014 20:55
Rewrite rule for IIS rewrites everything to https
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
courtesy of Sides of March
http://www.sidesofmarch.com/index.php/archive/2014/09/02/forcing-iis-to-rewrite-all-requests-to-https/
@mxmissile
mxmissile / gist:6a59527890e4be3d9213
Created July 21, 2014 22:26
@Html.LabelWithInput(...)
public static HtmlTag LabelWithInput<T>(this HtmlHelper<T> helper, Expression<Func<T, object>> expression) where T : class
{
var generator = GetGenerator<T>();
var label = generator.LabelFor(expression, model: helper.ViewData.Model);
var input = generator.InputFor(expression, model: helper.ViewData.Model);
var div = new DivTag();
div.AddClass("form-group");
div.Append(label);
div.Append(input);
public class FubuRegistry : Registry
{
public FubuRegistry()
{
var htmlConventionLibrary
= new HtmlConventionLibrary();
var conventions
= new OverrideHtmlConventions();
htmlConventionLibrary.Import(conventions.Library);
For<HtmlConventionLibrary>().Use(htmlConventionLibrary);